MySQL installation configuration
Operating system environment: redhat6.5 x64
MySQL version: 5.6.25
MySQL management tool: Navicat for MySQL 11.1.12
1. Download and install the software
Log in to MySQL website download: http://www.mysql.com/downloads/
Oracle Single User Login
Select Software and Platform:
Download:
2. Install MySQL
Reference Document: Http://dev.mysql.com/doc/refman/5.6/en/linux-installation.html
2.1 Creating a User
Useradd mysqlpasswd MySQL // Set Password
2.2 Unpacking Packages
Unzip v76360--rhel6. Zip
2.3 RPM Installation
[Email protected] soft]# RPM-IVH mysql-server-advanced-5.6. 1-ivh mysql-client-advanced-5.6. 1. el6.x86_64.rpm
Note: In most cases, you need to install only the MySQL-server and MySQL-client packages to get a functional MySQL installation
After installation in the Linux system directory structure:
Directory |
Contents of Directory |
/usr/bin |
Client Programs and Scripts |
/usr/sbin |
The mysqld server |
/var/lib/mysql |
Log files, databases |
/usr/share/info |
MySQL 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 I Nstallation |
/usr/share/sql-bench |
Benchmarks |
3. mysql Start and stop
MySQL installation is complete after starting the file MySQL under/ETC/INIT.D
Start
[[email protected] bin]#/etc/rc.d/init.d/mysql startstarting MySQL. SUCCESS!
Stop it
/usr/bin/mysqladmin-u root-p shutdown
4. Configure Remote Connection
Mysql> GRANT All privileges on * * to [email protected]'%'password ' 0 rows affected (0.01 sec) MySQL> FLUSH privileges;
5. Problems encountered during installation
Installation process met a few questions, online search answers to solve, thank you for sharing. Here again to summarize
Issue 1: System-Installed package conflicts
Solve
[Email protected] soft]# Rpm-qa | grep mysql // find conflicting packages mysql-libs-5.1. 1yum -y remove mysql-libs-5.1. 1. el6.x86_64 // Uninstall the package to install again
Issue 2: MySQL does not start after installation is complete
After the installation is complete, the connection to MySQL is not started and the error is as follows:
[[email protected] soft]# MySQL
ERROR 2002 (HY000): Can ' t connect to local MySQL server through socket '/var/lib/mysql/mysql.sock ' (2)
FIX: Start MySQL
Issue 3:error 1045 (28000): Access denied for user ' root ' @ ' localhost ' (using Password:no)
Solve:
[[email protected] bin]#/etc/init.d/mysql stop//force stop MySQL[Email protected] bin]#/usr/bin/mysqld_safe--skip-grant-tables--skip-networking &//[email protected] bin]# MySQL-u root mysqlmysql> Update user Set Password=password ('Password') Where user='Root'; Query OK,4Rows Affected (0.00sec) Rows matched:4Changed:4Warnings:0MySQL>FLUSH privileges; Query OK,0Rows Affected (0.01sec) MySQL>Quit[[email protected] bin]#/etc/init.d/mysql restart//Reboot two times[email protected] bin]# MySQL-u root mysqlmysql> SET Password=password ('Passw0rd');//you need to execute this command to continue with other commands
MySQL installation configuration