1. go to the Linux System mount CD (or download mysql-server MysqL), configure the yum Source
2. yum install-y mysql-server MySQL
3. Service mysqld start
4. Log in to the database MySQL [-u username] [-h host] [-p[password]] [dbname]
5. Change Password root User:usr/bin/mysqladmin-u root password ' new-password '
6. Database directory /var/lib/mysql/
7. configuration file /usr/share/mysql mysql.server command and configuration file
8. Related command /usr/bin (mysqladmin mysqldump , etc. )
9. startup script /etc/rc.d/init.d/ (startup script file mysql directory)
Display library show databases;
one. show tables in the database name of use database; show Tables;
showing the structure of the database table describe table name;
displaying records in a table select * from table name;
Build database name of database database;
Building a table
1) Use library name;
2)create table table name (field settings list);
CREATE TABLE guowq (ID int (3) auto_increment NOT null primary key, XM char (8), XB char (2), CSNY date);
Add record: INSERT INTOguowq values (' ', ' Guo Wenqiang , ' male , ' 1990-08-16 ');
modified record:update name set csny= ' 1971-01-10 ' where xm= ' Guo Wenqiang ';
Delete library and delete table: Drop database name; drop table name;
add Users: GRANT SELECT ON  database .* TO  @ login host identified by " password " ;
add a user user password is 123 Span style= "font-family: ' The song Body '; > so that he can log on on any host and have access to queries, insertions, modifications, and deletions to all databases. First for root user-attached mysql
Grant select,insert,update,delect on *.*to [email protected] " % " identified by " 123 " ;
. Backup and recovery:
1) Backup
Mysqldump-u root-p--opt library name > Library name . bak;
2) Recovery
Mysql-u root-p Library name . bak < library name ;
This article is from the "Menlong" blog, make sure to keep this source http://7616247.blog.51cto.com/7606247/1653815
Install MySQL and simple operation under Linux