PuTTY上MySQL数据库如何安装与卸载

下面一起来了解下PuTTY上MySQL数据库如何安装与卸载,相信大家看完肯定会受益匪浅,文字在精不在多,希望PuTTY上MySQL数据库如何安装与卸载这篇短内容是你想要的。 

  卸载Mysql

  输入命令,完全卸载

  >sudo apt-get remove mysql-*

  >dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P

  安装

  >sudo apt-get install mysql-server-5.7

  测试

  >mysql --version

  

PuTTY上MySQL数据库如何安装与卸载


  查看mysql状态

  >service mysql status

  查看mysql是否启动

  >active (running)

  通过外网地址访问,访问不到,由于mysql的安全限制

  登录本地mysql

  》mysql -h227.0.0.1 -u用户名 -p密码

  (1)修改用户表信息

  >show databases;

  >use mysql;

  >show tables;

  >select user,host from user;

  >update user set host='%' where user = 'root'; //更新用户root的host为%,表示在所有主机下都可以登录

  重新启动

  >sudo service mysql restart

  (2)修改mysql云服务器的配置

  >sudo vi /etc/mysql/my.cnf

  添加以下代码

  [client]无锡好的×××医院 http://www.zzchnk.com/

  default-character-set=utf8

  [mysqld]

  character-set-server=utf8

  max_connections=1000

  !includedir /etc/mysql/conf.d/

  !includedir /etc/mysql/mysql.conf.d/

  bind-address=0.0.0.0

  重启mysql服务

  >sudo service mysql restart

  测试

  >mysql -hxxx.xxx.xxx.xxx -u用户名 -p密码 //登录自己的远程数据库

看完PuTTY上MySQL数据库如何安装与卸载这篇文章后,很多读者朋友肯定会想要了解更多的相关内容,如需获取更多的行业信息,可以关注我们的行业资讯栏目。