Ubuntu16.04中MySQL安装配置
2016-10-10 18:07
519 查看
4#Ubuntu16.04中MySQL安装配置
[TOC]
期间会弹出设置root账户的密码框,输入两次相同密码。
进入mysql root账户
在mysql环境中输入grant all on . to username@’%’ identified by ‘password’;
或者grant all on . to username@’%’ identified by ‘password’ with grand option;
刷新flush privileges;然后重启mysql,通过/etc/init.d/mysql restart命令
远程连接时客户端设置:
[TOC]
1、安装mysql
root@ubuntu:~# sudo apt-get install mysql-server
root@ubuntu:~# apt install mysql-client
root@ubuntu:~# apt install libmysqlclient-dev
期间会弹出设置root账户的密码框,输入两次相同密码。
2、查询是否安装成功
root@ubuntu:~# sudo netstat -tap | grep mysql
root@ubuntu:~# netstat -tap | grep mysql tcp6 0 0 [::]:mysql [::]:* LISTEN 7510/mysqld
3、开启远程访问mysql
编辑mysql配置文件,注释掉“bind-address = 127.0.0.1”root@ubuntu:~# vi /etc/mysql/mysql.conf.d/mysqld.cnf
#bind-address = 127.0.0.1
进入mysql root账户
root@ubuntu:~# mysql -u root -p123456
在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 china@'%' identified by '123456';
刷新flush privileges;然后重启mysql,通过/etc/init.d/mysql restart命令
root@ubuntu:~# flush privileges;
root@ubuntu:~# /etc/init.d/mysql restart
远程连接时客户端设置:
4、常见问题
1045 access denied for user ‘root’@’localhost(ip)’ using password yes1、mysql -u root -p; 2、GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION; 3、FLUSH PRIVILEGES;
相关文章推荐
- UBUNTU16.04 mysql 安装与配置
- MySQL学习笔记(一)Ubuntu16.04中MySQL安装配置(5.6优化、错误日志、DNS解决)
- mysql 5.7.16 安装配置方法图文教程(ubuntu 16.04)
- ubuntu 16.04 mysql的安装以及配置
- Ubuntu Server 16.04下安装及配置MySQL
- Ubuntu16.04服务器安装配置MySQL并开启远程连接
- mysql 5.7.17 安装配置方法图文教程(ubuntu 16.04)
- Ubuntu16.04 下安装 MySQL 及配置
- ubuntu16.04安装mysql并配置远程访问
- ubuntu 16.04 配置 安装 java1.8 tomcat7 mysql5.7
- Ubuntu16.04中MySQL安装配置打开"终端窗口",输入"sudo apt-get update
- ubuntu 16.04 mysql安装,配置,修改编码改为utf-8
- Ubuntu16.04中MySQL安装配置及修改字符集编码
- ubuntu mysql安装和配置总结
- ubuntu下安装配置mysql全过程
- Ubuntu 9.10 安装配置 MySQL
- Ubuntu安装配置Mysql
- ubuntu下mysql的安装与配置
- ubuntu下MySQL的安装及远程连接配置
- Ubuntu下MySQL安装与配置