Linux MySQL on-load except 1, original MySQL component find/-name MySQL Delete related files 2, check if there is MySQL RPM installation package RPM-QA | Grep-i MySQL if available delete yum-y remove mysql-libs* install 1, upload rpm file mysql-server-5.6.31-1.linux_glibc 2.5.x86_64.rpm mysql-devel-5.6.31-1.linux_glibc2.5.x86_64.rpm mysql-client-5.6.31-1.linux_glibc2.5.x86_64.rpm 2, installing RPM RPM-IVH mysql-server-5.6.31-1.linux_glibc2.5.x86_64.rpm RPM-IVH mysql-devel-5.6.31-1.linux_ glibc2.5.x86_64.rpm RPM-IVH mysql-client-5.6.31-1.linux_glibc2.5.x86_64.rpm 3, copy the MySQL configuration file to the/etc directory. Cp/usr/share/mysql/my-default.cnf/etc/my.cnf 4, initialize MySQL and set the password. /usr/bin/mysql_install_db #初始化 mysql service mysql start #启动 mysql cat/root/.mysql_secret #查看root账号的初始密码, the following information is displayed Mys Ql-u Root-ppassword #连接数据库 Set Password=password (' root '); #设置密码 5, set boot chkconfig mysql on #添加开机启动 [[Email protected]_32_234_centos storage]# chkconfig--list | grep mysql mysql 0:off 1:off 2:on 3:on 4:on 5:on 6:off 6, modify/etc/my.cnf [mysqld] DataDir =/data/sinodata/pushserver/mysql/data Port = 6622 7, copy file/var/lib/mysql/ to /data/sin Odata/pushserver/mysql/data cp-r/var/lib/mysql/*/data/sinodata/pushserver/mysql/data 8, giving/data/sinodata/ Pushserver/mysql/data folder permissions 9,# service mysql restart shutting down MySQL. success! Starting MySQL. SUCCESS! 10, the database file is in/data/sinodata/pushserver/mysql/data, the port number is 6622 chmod-r 777/data/sinodata/pushserver/ mysql/data remote connection problem after local connection, the user is authorized mysql>grant all privileges on * * to ' userName ' @ '% ' identified by ' Userpasswor d ' with GRANT option; Mysql>flush privileges;
Linux MySQL installation