Linux-MySQL安装

    xiaoxiao2021-04-16  204

    这里写自定Mysql安装二

    create user 'sam' identified by 'laohuoji'; 授权 登录mysql后输入如下命令: grant all privileges on *.* to 'root' @'%' identified by '密码'; 刷新配置 flush privileges;grant all on test.* to 'sam';

    yum 命令安装mysql 此版本mysql服务名称为mysqld

    查看MySQL版本 yum list mysql*

    下载并安装MySQL yum install mysql*

    启动服务 service mysqld start

    添加服务到开机启动 chkconfig --add mysqld chkconfig mysqld on 设置Mysql密码

    /usr/bin/mysqladmin -u root password ‘new-password’ 创建用户

    create user ‘sam’ identified by ‘laohuoji’; 授权 登录mysql后输入如下命令: grant all privileges on . to ‘root’ @’%’ identified by ‘密码’; 刷新配置 flush privileges;

    grant all on test.* to ‘sam’;

    开放端口号

    开放Linux的对外访问的端口3306 /sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT /etc/rc.d/init.d/iptables save —将修改永久保存到防火墙中义目录标题)


    最新回复(0)