Ubuntu下安装使用Mysql

1. 安装 sudo apt-get install mysql-server 

2. 安装过程中设置用户及密码

3.启动:/etc/init.d/mysql start  停止:/etc/init.d/mysql stop 重启:/etc/init.d/mysql restart

4.设置Mysql可以远程访问

    修改/etc/mysql/my.cnf中bind-address项,注掉   且可在此修改mysql的各配置

    mysql -u用户名 -p密码登陆

    grant all privileges on *.* to 用户名@"%" identified by "密码" with grant option;

    flush privileges;

    对账户进行授权

猜你喜欢

转载自wangtaoenter.iteye.com/blog/1634102