LINUX系统安装配置Mysql

1.安装mysql(1)解压缩文件,修改名字为mysqlusr/local/mysqll(2)创建data目录/usr/local/mysql/data(3)创建用户组以及用户groupaddmysqluseraddmysql-gmysql(4)对mysql目录授权chown-Rmysql.mysql/usr/local/mysql(5)初始化安装,记住初始化密码/usr/local/mysql/bin/mysqld--initialize--user=mysql--datadir=/usr/local/mysql--datadir=/usr/local/mysql/data(6)复制启动脚本到资源目录cp./support-files/mysql.server/etc/rc.d/init.d/mysqld(7)增加mysqld服务控制脚本执行权限chmod+x/etc/rc.d/init.d/mysqld(8)mysqld服务加入系统服务chkconfig--addmysqldchkconfig--listmysqld(9)启动mysql服务servicemysqldstart(10)启动失败,找不到mysql命令ln-s/usr/local/mysql/bin/mysql/usr/bin(11)登录mysqlmysql-uroot-p(12)登录失败,ERRORln-s/var/lib/mysqld/mysql.sock/tmp/mysql.sock(13)修改密码ALTERUSER‘root’

’localhost’IDENTIFIEDBY‘密码’;flushprivileges;(14)开启端口firewall-cmd–permanent–zone=public–add-port=/tcpfirewall-cmd--reload(15)测试连接报错,host‘ip’isnotallowedGRANTALLPRIVILEGESON*.*TO‘用户名’

’%’IDENTIFIEDBY‘密码’WITHGRANTOPTION;flushprivileges;


转载请注明:http://www.aierlanlan.com/rzdk/8545.html

  • 上一篇文章:
  •   
  • 下一篇文章: 没有了