linux系统安装mysql

一、下载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;
相关文章
相关标签/搜索