一、下載mysqlnode
wget http://downloads.mysql.com/archives/get/file/MySQL-5.6.35-1.linux_glibc2.5.x86_64.rpm-bundle.tar # 安裝依賴 yum -y install perl perl-devel autoconf libaio
二、卸載已安裝的mysql版本mysql
查看是否安裝mysqllinux
rpm -qa | grep -i mysqlsql
卸載mysql數據庫
rpm -ev mysql-libs-5.1.61-4.el6.x86_64 --nodepside
三、解壓mysqlcode
tar -xvf MySQL-5.6.35-1.linux_glibc2.5.x86_64.rpm-bundle.tar
四、安裝數據庫server
#安裝mysql的server端 rpm -ivh MySQL-server-5.6.35-1.linux_glibc2.5.x86_64.rpm #安裝mysql客戶端 rpm -ivh MySQL-client-5.6.35-1.linux_glibc2.5.x86_64.rpm
五、啓動mysqlblog
service mysql start
六、修改mysql初始密碼rem
#查看初始密碼 cat /root/.mysql_secret #修改密碼命令 /usr/bin/mysql_secure_installation #改變root用戶密碼 Change the root password? [Y/n] y Remove anonymous users? [Y/n] y Disallow root login remotely? [Y/n] n Remove test database and access to it? [Y/n] y Reload privilege tables now? [Y/n] y
七、登錄mysql
mysql -uroot -p 密碼
八、修改權限
grant all privileges on *.* to 'root'@'%' identified by '123456'; flush privileges;