1. Check if MySQL is installed on the system
Use the command:
#rpm-qa | GrepMySQL
2. Uninstall the installed MySQL
Uninstall the MySQL command as follows:
#rpm-E--nodeps mysql-libs-5.1.61-4.el6.x86_64
To remove all files under the/var/lib/mysql folder clean
3. Install the new MySQL
The command is as follows:
#rpm-IVH mysql-server-5.5.30-1.el6.x86_64.rpm
#rpm-IVH mysql-client-5.5.30-1.el6.x86_64.rpm
#rpm-IVH mysql-devel-5.5.30-1.el6.x86_64.rpm
4. Start the MySQL service
Method One: Restart the system
Method Two: #service MySQL start
To see how MySQL is running:
Using the command: #/etc/rc.d/init.d/mysql status
Result: The display "SUCCESS" is already running
Show "FAILED" is not running
MySQL service some other commands
A. See if MySQL is in the auto-start list: #/sbin/chkconfig–list
B. Add MySQL to System self-boot service group: #/sbin/chkconfig–add MySQL
C. remove MySQL from the Startup service group: #/sbin/chkconfig–del MySQL
D, stop MySQL service: # service MySQL Stop
E, script start MySQL service: #/etc/rc.d/init.d/mysqld start
F, script stop MySQL service: #/etc/rc.d/init.d/mysqld stop
5. Set the root password for MySQL after the installation is complete.
The command is as follows:
#/usr/bin/mysqladmin-u root password ' 123456 '
6. mysql Installation directory description
/var/lib/mysql Database files
/usr/share/mysql commands and configuration files
/usr/bin (Mysqladmin, mysqldump and other commands)
7, Linux installed under the MySQL table name is case-sensitive, if not case-sensitive, you can use the following ways
1, copy/usr/share/mysql/my-huge.cnf to/ETC/MY.CNF (if you already have the file can be modified directly)
The command is as follows: # CP/USR/SHARE/MYSQL/MY-HUGE.CNF/ETC/MY.CNF
2. Modify the My.cnf file
increase under [mysqld]
Lower_case_table_names=1 #表名全部为小写 to avoid case sensitivity
3. Restart MySQL
# service MySQL Restart
8 (optional), assigning permissions to MySQL-connected hosts (for remote connection to MySQL database):
The command is as follows:
>mysql Grant All on * * to ' username ' @ ' percent ' identified by ' password ' with GRANT OPTION; XXX.XXX.X.XX is your IP.
9 (optional), change MySQL default character set (The default character set is the same as the operating system character set, so no setting is required)
View MySQL character set:mysql> show variables like ' character_set_% ';
1. Query and install the same as above
2. After MySQL 5.6 is installed, the password is saved in the file:
/root/.mysql_secret
3. Start the MySQL service ,
Service MySQL Start
4. Modify the MySQL root password :
mysql> SET PASSWORD for ' root ' @ ' localhost ' = PASSWORD (' Newpass ');
Reference: http://www.server110.com/mysql/201312/3792.html