Today, there is a MySQL database on the server, remote access, do not want to disclose the root account, so, create a demo account, allow demo account anywhere can access the MySQL database Shandong Library.
programme I:
Running on a
Create 2 User table users, User2, and the same table structure, but the user table uses the InnoDB storage engine, and the User2 table uses the MyISAM storage engine.
Copy Code code as follows:
--Table "user" DDL
CREATE TABLE '
1. Create databases and datasheets with phpMyAdminWhen you create a database, set the collation to: "Utf8_general_ci"Or execute the statement:
Copy Code code as follows:
CREATE DATABASE ' dbname ' DEFAULT CHARACTER SET UTF8 COLLATE utf8
Share a little of my experience here
When you first started learning SQL, you would write this
Copy Code code as follows:
SELECT * FROM table order by ID LIMIT 1000, 10;
But when the data reaches millions, the writing slows
The following step-by-step to introduce you to the very detailed, specific details please see below.
First, prepare
Test with two servers:
Master Server:192.0.0.1/linux/mysql 4.1.12Slave Server:192.0.0.2/linux/mysql 4.1.18
Master from the
How to solve the MySQL 5 0 16 garbled problem? This article gives the solution:Q: How to solve the MySQL 5.0.16 garbled problem?A: MySQL 5.0.16 garbled problem can be solved in the following way:1. Set phpMyAdminLanguage:chinese Simplified (zh-utf-8)
This is what I saw on the internet a good MySQL database optimization article, the content is very full!
1, use the index to traverse the table faster
The index established by default is not a clustered index, but sometimes it is not optimal.
LNMP a key package installed MySQL default open MySQL log, if the site on the database read and write more frequently may generate a large number of logs, and occupy disk space, but also may lead to the VPS's hard disk idle space consumption full
Copy Code code as follows:
# VI Mysqlusers.txt
Create Database Dataname;
Grant all privileges on dataname.* to username@localhost identified by ' password ';
Flush privileges;
#/usr/local/mysql/bin/mysql-u root-p Password
Brief Introduction
Xtrabackup is the MySQL database Backup tool provided by Percona, according to the official, this is also the world's only one by one open source to be able to the InnoDB and XTRADB database hot standby tool. Characteristics:
(1)
PHP writes data to a MySQL database in three steps:
1,php and MySQL establish a connection relationship
2, open MySQL database
3, accept the page data, PHP input to the specified table
1, 22 steps can directly use a database link file can: conn.php
For MySQL databases, you must use the InnoDB engine if you want to use transactions and row-level locks. If you want to use Full-text indexing, you must use MyISAM. InnoDB's practicality, security, stability is higher but the efficiency than myisam
For the solution of the virtual machine Linux side MySQL database can not be remote access one of the following content I have to organize two solutions, the details are as follows:
Workaround One:
1, in the console execution Mysql-u root-p
First, InnoDB row lock classification
Record lock: Records locks, which is just a single line locked
Gap Lock: An interval lock that only locks an interval (note that the interval here is open, i.e. excluding boundary values.)
Next-key Lock:record
SQL code
Copy Code code as follows:
/*
Navicat MySQL Data Transfer
Source server:local
Source Server version:50022
Source host:localhost:3306
Source Database:test
Target Server Type:mysql
Target Server version:50
1. Question: MySQL DNS anti-solution: Skip-name-resolveThe error log has a similar warning:
1.120119 16:26:04 [Warning] IP address ' 192.168.1.10 ' could the not to resolved:name or service not known2.120119 16:26:04 [Warning] IP address ' 192.168.1
After you connect to the MySQL database, there may be several database operations available, so you need to select the database you want to manipulate.Select the MySQL database from the command Prompt windowYou can easily select a specific database
Now to introduce the MySQL command line, from the establishment of the database to the table data delete the whole process, I hope to help.
Login MySQL
Play cmd command terminal, if you have added a MySQL environment variable, you can directly use
Date_forma T (date, format) returns a string of results based on format date or date and time value date according to the format string formatting.
You can format date or datetime values in Date_format () to get the desired format. Format date
1
How to implement the following SQL query in MySQL
(SELECT s.name
From STUDENT S, transcript T
WHERE S.studid = t.studid and T.crscode = ' CS305 ')
INTERSECT
(SELECT s.name
From STUDENT S, transcript T
WHERE S.studid = t.studid and T.crscode = ' CS3
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service