1需求
2工具
ubuntu 14.04
mysql
navicat for mysql
3步骤
3.1安装
>sudo apt-get install mysql-server
>apt-get isntall mysql-client
>sudo apt-get install libmysqlclient-dev
默认用户名root,密码安装时设定
3.2查看mysql状态
>sudo netstat -tap | grep mysql
3.3登录
>mysql -u root -p
输入密码登录
>show databases;
3.4配置外部连接
3.4.1.1配置已有用户远程连接
>update user set host='%' where user='root' and host='localhost';
%代表所有IP都可以访问
3.4.1.2新建可以远程访问用户
>create user 'username'@'%' identified by 'passwd';
>grant all privileges on dbname.* TO username;
3.4.2修改/etc/mysql/my.cnf
>vim /etc/mysql/my.cnf
旧版本5.0版本中注释掉skip-networking
新版本中注释掉 bind_address = 127.0.01
3.4.3重启
>/etc/init.d/mysql restart
4 使用客户连接即可