Install MySQL as an rpm package, and mysql as an rpm package
1. Download the rpm package required for Mysql Installation
http://cdn.mysql.com/Downloads/MySQL-5.6/MySQL-server-5.6.21-1.linux_glibc2.5.x86_64.rpmhttp://cdn.mysql.com/Downloads/MySQL-5.6/MySQL-client-5.6.21-1.linux_glibc2.5.x86_64.rpmhttp://cdn.mysql.com/Downloads/MySQL-5.6/MySQL-devel-5.6.21-1.linux_glibc2.5.x86_64.rpm
2. Installation
[root@Luxh-01 softs]# rpm -ivh MySQL-server-5.6.21-1.linux_glibc2.5.x86_64.rpm
[root@Luxh-01 softs]# rpm -ivh MySQL-client-5.6.21-1.linux_glibc2.5.x86_64.rpm
[root@Luxh-01 softs]# rpm -ivh MySQL-devel-5.6.21-1.linux_glibc2.5.x86_64.rpm
During the installation process, Mysql will generate a random password for the root user, and the password is stored in/root/. mysql_secret.
MySQL installation directory information:
Directory |
Contents of Directory |
/usr/bin |
Client programs and scripts |
/usr/sbin |
TheMysqldServer |
/var/lib/mysql |
Log files, databases |
/usr/share/info |
Manual in Info format |
/usr/share/man |
Unix manual pages |
/usr/include/mysql |
Include (header) files |
/usr/lib/mysql |
Libraries |
/usr/share/mysql |
Miscellaneous support files, including error messages, character set files, sample configuration files, SQL for database installation |
/usr/share/sql-bench |
Benchmarks |
3. Start MySQL:
[Root @ Luxh-01 ~] # Service mysql startStarting MySQL... [OK] [root @ Luxh-01 ~] # Service mysql statusMySQL running (3270) [OK]
4. log on to MySQL
[root@Luxh-01 ~]# mysql -uroot -p
Enter the random password generated during installation to log on to the MySQL command line interface.
5. Modify the root user password
mysql> set password = password('123456');
6. Copy/usr/share/mysql/my-default.cnf to/etc/my. cnf
[root@Luxh-01 mysql]# pwd/usr/share/mysql[root@Luxh-01 mysql]# cp my-default.cnf /etc/my.cnf[root@Luxh-01 mysql]#
You can modify/etc/my. cnf as needed, and then restart mysql.
7. Allow Remote root Login
mysql> grant all on *.* to root@'%' identified by "123456";Query OK, 0 rows affected (0.02 sec)mysql> flush privileges;Query OK, 0 rows affected (0.00 sec)mysql>