打开主菜单
首页
随机
登录
设置
关于woodrow
免责声明
woodrow
搜索
查看“MySQL”的源代码
←
MySQL
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看和复制此页面的源代码。
== MySQL Community Server == https://downloads.mysql.com/archives/community/ == 卸载MariaDB == <syntaxhighlight lang="bash"> rpm -qa | grep -i mariadb rpm -e mariadb-libs-5.5.68-1.el7.x86_64 --nodeps </syntaxhighlight> == 创建目录、解压 == <syntaxhighlight lang="bash"> mkdir mysql tar -xvf mysql-8.0.26-1.el7.x86_64.rpm-bundle.tar -C mysql </syntaxhighlight> == 安装MySQL == <syntaxhighlight lang="bash"> cd mysql rpm -ivh mysql-community-common-8.0.26-1.el7.x86_64.rpm rpm -ivh mysql-community-client-plugins-8.0.26-1.el7.x86_64.rpm rpm -ivh mysql-community-libs-8.0.26-1.el7.x86_64.rpm rpm -ivh mysql-community-libs-compat-8.0.26-1.el7.x86_64.rpm yum install openssl-devel rpm -ivh mysql-community-devel-8.0.26-1.el7.x86_64.rpm rpm -ivh mysql-community-client-8.0.26-1.el7.x86_64.rpm rpm -ivh mysql-community-server-8.0.26-1.el7.x86_64.rpm </syntaxhighlight> == 启动MySQL服务 == <syntaxhighlight lang="bash"> systemctl start mysqld </syntaxhighlight> == 查询自动生成的root用户密码 == <syntaxhighlight lang="bash"> grep 'temporary password' /var/log/mysqld.log </syntaxhighlight> <syntaxhighlight lang="bash"> mysql -u root -p </syntaxhighlight> == 修改root用户密码 == <pre> set global validate_password.policy = 0; set global validate_password.length = 8; </pre> <syntaxhighlight lang="mysql"> ALTER USER 'root'@'localhost' IDENTIFIED BY 'password'; </syntaxhighlight> == 创建用户 == <syntaxhighlight lang="mysql"> CREATE USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'password'; </syntaxhighlight> == 授予权限 == <syntaxhighlight lang="mysql"> GRANT ALL ON *.* TO 'root'@'%'; </syntaxhighlight> == 重新连接MySQL == <syntaxhighlight lang="bash"> mysql -u root -p </syntaxhighlight>
返回至
MySQL
。