1. The mariadb and MySQL conflicts need to be uninstalled.
2, the original installed MySQL does not uninstall cleanly will cause the installation failure.
3, MySQL folder permissions need to give enough, MY.CNF is the same.
4, the installation process if there are other problems are likely to be the system is not installed some things, with the Yum command to install the necessary things, the problem of direct search, according to the need for something to download, because the system is different, not listed here.
Installation process Reference:
———————————————————————————————————————————
First, install MySQL
1, download the installation package mysql-advanced-5.6.24-linux-glibc2.5-x86_64.tar.gz (download the required version according to your needs)
http://mirrors.sohu.com/mysql/
The original author of the connection is not available, recommend this Chinese image, download faster than the official website!
2, the unloading system comes with the MARIADB
[[Email protected]~]# rmp-qa|grep mariadb//query out installed mariadb[[email protected]~]# pm-e--nodeps filename//One by one uninstall
3. Delete the my.cnf file under the ETC directory
[[Email protected]~]# rm/etc/my.cnf
4. Execute the following command to create the MySQL user group
[Email protected]~]# groupadd MySQL
5. Execute the following command to create a user named MySQL and join the MySQL user group
6. Put the downloaded binary compression package into the/usr/local/directory.
7. Unpack the installation package
[Email protected] ~]# TAR-ZXVF mysql-advanced-5.6.24-linux-glibc2.5-x86_64.tar.gz
8. Rename the extracted folder to MySQL
9. Create a new profile my.cnf under etc, and add the following code within the file:
Press CTRL + C to copy the code
Press CTRL + C to copy the code
10. Go to install MySQL software catalog
[Email protected] ~]# cd/usr/local/mysql[[email protected] mysql]# chown-r mysql:mysql./Modify the current directory owner for the MySQL user [[Email Pro Tected] mysql]#./scripts/mysql_install_db--user=mysql Installation database [[email protected] mysql]# chown-r mysql:mysql data Modify Current DAT A directory owner for MySQL users
The installation of this database is complete!
Second, configure MySQL
1, Grant my.cnf the maximum permissions.
[Email protected] ~]# chown 777/etc/my.cnf
To set the start-Up service control script:
2. Copy the startup script to the resource directory
[email protected] mysql]# CP./support-files/mysql.server/etc/rc.d/init.d/mysqld
3. Increase MYSQLD Service control script execution permissions
[Email protected] mysql]# chmod +x/etc/rc.d/init.d/mysqld
4. Add mysqld service to system service
[Email protected] mysql]# chkconfig--add mysqld
5, check whether the MYSQLD service has been effective
[Email protected] mysql]# chkconfig--list mysqld
The command output resembles the following result:
Mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off
Indicates that the MYSQLD service is in effect and starts automatically with the system boot at the 2, 3, 4, 5 runlevel, and can be used to control the start and stop of MySQL later using the service command.
6. Start mSQL (Stop mysqld Services: Service mysqld stop)
[[Email protected] mysql]# service mysqld start
7. Add the MySQL bin directory to the PATH environment variable and edit the/etc/profile file
[Email protected] mysql]# Vi/etc/profile
At the end of the file, add the following information:
[Email protected] mysql]# export path= $PATH:/usr/local/mysql/bin
Execute the following command to make the changes take effect:
[Email protected] mysql]#. /etc/profile
8, login to the root account MySQL, the default is no password
[Email protected] mysql]# mysql-u root-p
9, set the root account password Note the following you password changed to your password to change
[[Email protected] mysql]# Update user set Password=password (' You password ') where user= ' root ' and host= ' localhost ';
10, set the remote host login (I use NAVICAT) Note the following your username and your password change to the user and password you need to set
[[email protected] mysql]# GRANT all privileges on * * to ' your username ' @ '% ' identified by ' your password ' with GRANT OPT ION;
Reprinted from: http://www.cnblogs.com/yunns/p/4877333.html
CENTOS7 installation mysql5.6 points to note