Ubuntu16.04中MySQL安装配置
来源:互联网 发布:seo研究中心新浪微博 编辑:程序博客网 时间:2024/05/21 04:26
1、安装mysql
root@ubuntu:~# sudo apt-get install mysql-server
- 1
- 1
root@ubuntu:~# apt install mysql-client
- 1
- 1
root@ubuntu:~# apt install libmysqlclient-dev
- 1
- 1
期间会弹出设置root账户的密码框,输入两次相同密码。
2、查询是否安装成功
root@ubuntu:~# sudo netstat -tap | grep mysql
- 1
- 1
root@ubuntu:~# netstat -tap | grep mysqltcp6 0 0 [::]:mysql [::]:* LISTEN 7510/mysqld
- 1
- 2
- 3
- 1
- 2
- 3
3、开启远程访问mysql
- 编辑mysql配置文件,注释掉“bind-address = 127.0.0.1”
root@ubuntu:~# vi /etc/mysql/mysql.conf.d/mysqld.cnf
- 1
- 1
#bind-address = 127.0.0.1
- 1
- 1
- 进入mysql root账户
root@ubuntu:~# mysql -u root -p123456
- 1
- 1
- 在mysql环境中输入grant all on . to username@’%’ identified by ‘password’;
- 或者grant all on . to username@’%’ identified by ‘password’ with grand option;
root@ubuntu:~# grant all on *.* to xxx@'%' identified by '123456';
- 1
- 1
- 刷新flush privileges;然后重启mysql,通过/etc/init.d/mysql restart命令
root@ubuntu:~# flush privileges;
- 1
- 1
root@ubuntu:~# /etc/init.d/mysql restart
- 1
- 1
- 远程连接时客户端设置:
4、常见问题
- 1045 access denied for user ‘root’@’localhost(ip)’ using password yes
1、mysql -u root -p;2、GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;3、FLUSH PRIVILEGES;
阅读全文
0 0
- Ubuntu16.04中MySQL安装配置
- Ubuntu16.04中MySQL安装配置
- Ubuntu16.04中MySQL安装配置
- Ubuntu16.04中MySQL安装配置
- Ubuntu16.04中MySQL安装配置及修改字符集编码
- Ubuntu16.04 下安装 MySQL 及配置
- UBUNTU16.04 mysql 安装与配置
- 在Ubuntu16.04中安装MySQL
- ubuntu16.04安装mysql
- Ubuntu16.04安装mysql
- Ubuntu16.04安装mysql
- ubuntu16.04安装mysql
- Ubuntu16.04安装mysql
- Ubuntu16.04安装mysql
- ubuntu16.04安装mysql
- Ubuntu16.04 中 phpmyadmin安装 mysql卸载 mysql外部访问
- Ubuntu16.04下MySQL的安装与配置(UTF8)
- Ubuntu16.04服务器安装配置MySQL并开启远程连接
- linux 下安装tomcat
- Git常用命令
- leetcode -- Single number
- 爬虫实战----从免费IP代理网站获取连接率较好的可用IP
- [PAT乙级]1034. 有理数四则运算(20)
- Ubuntu16.04中MySQL安装配置
- banner使用
- ubuntu 安装ftp
- [重磅][ZJOI]XYL算法
- gitlab (朋友写的)
- uva-10305拓扑排序水一发
- js实现城市列表的三级联动
- Ubuntu16.04中MySQL安装配置
- [HNOI2008]玩具装箱TOY