First, check if MySQL is installed on the system
[Email protected] ~]# Rpm-qa | grep MySQL
Mysql-devel-5.1.73-7.el6.x86_64
Mysql-server-5.1.73-7.el6.x86_64
Mysql-libs-5.1.73-7.el6.x86_64
Mysql-5.1.73-7.el6.x86_64
Second, uninstall the original MySQL
RPM-E--nodeps MySQL
Third, install MySQL
1. View MySQL-related software in Yum server
Yum List | grep MySQL
2. Download
Yum install MySQL
Last show:
Installed:
Mysql.x86_64 0:5.1.73-7.el6
complete!
Iv. Common operation
1. Start-up services: Service mysqld start
2. Set the password for the root account:/usr/bin/mysqladmin-u root Password your password
3. Login Mysql:mysql-u root-p
V. Configuration files
1. master configuration file: vi/etc/my.cnf
[Mysqld]
Datadir=/var/lib/mysql
Socket=/var/lib/mysql/mysql.sock
User=mysql
# Disabling Symbolic-links is recommended to prevent assorted security risks
Symbolic-links=0
[Mysqld_safe]
Log-error=/var/log/mysqld.log
Pid-file=/var/run/mysqld/mysqld.pid
2. Data file storage directory: Ll/var/lib/mysql
[Email protected] ~]# Ll/var/lib/mysql
Total 20488
-RW-RW----. 1 mysql mysql 10485760 Dec 11:43 ibdata1
-RW-RW----. 1 mysql mysql 5242880 Dec 11:43 ib_logfile0
-RW-RW----. 1 mysql mysql 5242880 Dec 11:43 ib_logfile1
DRWX------. 2 mysql mysql 4096 Dec 11:43 MySQL
Srwxrwxrwx. 1 mysql mysql 0 Dec 11:43 mysql.sock
DRWX------. 2 mysql mysql 4096 Dec 11:43 test
3. Log directory: Ll/var/log | grep MySQL
-rw-r-----. 1 MySQL mysql 1279 Dec 11:43 mysqld.log
Centos6.5yum installing MySQL