1. Download the appropriate version of the website https://dev.mysql.com/downloads/mysql/5.6.html#downloads
2. Extracting files
tar -zxvf mysql-5.6. -LINUX-GLIBC2. A
3. Copy the extracted MySQL files to the system local software directory
CP mysql-5.6. -LINUX-GLIBC2. -x86_64/usr/local/mysql-r
4. Add user groups and users
-G MySQL MySQL
5.
To Install the database:
Go to install MySQL software directory: Execute command cd/usr/local/mysql
Modify current directory owner for MySQL User: Execute command chown-r mysql:mysql.
Install database: Executes the command./scripts/mysql_install_db--user=mysql
Modify the current directory owner as root User: Execute command chown-r root:root.
Modify the current data directory owner for MySQL User: Execute command chown-r mysql:mysql data
6. start the MySQL service and add the boot MySQL service:
Add Boot: Execute command CP Support-files/mysql.server/etc/init.d/mysql, put startup script into boot initialization directory
Start MySQL service: Execute command service MySQL start
Execute command: ps-ef|grep mysql see MySQL service description started successfully
7. Error when changing password
To modify the root user password of MySQL, the root initial password is empty:
Execute command:./bin/mysqladmin-u root password ' password ', error at this time
Follow these methods: Https://www.cnblogs.com/gumuzi/p/5711495.html modified successfully
Other errors:
Err message : Error 2002 (HY000): Can ' t connect to local MySQL server through socket '/tmp/mysql.sock ' (2)
workaround : Open/etc/my.cnf to see what directory the socket is configured in. "Socket=/var/lib/mysql/mysql.sock"
The path and "/tmp/mysql.sock" are inconsistent. Establish a soft connection: Ln-s/var/lib/mysql/mysql.sock/tmp/mysql.sock
Reference: https://www.cnblogs.com/fnlingnzb-learner/p/5830622.html
Https://www.cnblogs.com/bookwed/p/5896619.html
Https://www.cnblogs.com/gumuzi/p/5711495.html
Install MySQL under Linux