- 首先安装:sudo apt-get install mysql-server
- 启动mysql:sudo serice mysql start(stop/restart),注意使用这几条命令的时候要耐心等待,负责会有好多mysql相关的进程在运行,结果就是运行不起来(can't connect to local mysql server through socket '/var/run/mysqld/mysqld.sock'就是因为启动不起来所引发的错误),要去kill掉:ps aux|grep mysql,查看到好多相关进程,统统kill掉 kill -sigkill 进程号,搞定之后可以启动,进入下一步。
- mysql> grant all on *.* to 'root'@'%' identified by 'root password';,如果要设置为任何客户端都可以以root连接的话,可以这么写,普通格式:grant select on 数据库.* to 用户名@登录主机 identified by "密码"。执行上述语句之后,在执行:flush privileges;,方可立即生效
- 修改bind-address 在/etc/mysql/my.cnf中,将将”bind-address = 127.0.0.1“注释,重启mysql既可以远程访问
Showing posts with label software. Show all posts
Showing posts with label software. Show all posts
Wednesday, May 26, 2010
Ubunu 10.04 设置MySQL 5.1 远程访问
Tuesday, May 25, 2010
Ubunu 10.04 设置MySQL 5.1 远程访问
- 首先安装:sudo apt-get install mysql-server
- 启动mysql:sudo serice mysql start(stop/restart),注意使用这几条命令的时候要耐心等待,负责会有好多mysql相关的进程在运行,结果就是运行不起来(can't connect to local mysql server through socket '/var/run/mysqld/mysqld.sock'就是因为启动不起来所引发的错误),要去kill掉:ps aux|grep mysql,查看到好多相关进程,统统kill掉 kill -sigkill 进程号,搞定之后可以启动,进入下一步。
- mysql> grant all on *.* to 'root'@'%' identified by 'root password';,如果要设置为任何客户端都可以以root连接的话,可以这么写,普通格式:grant select on 数据库.* to 用户名@登录主机 identified by "密码"。执行上述语句之后,在执行:flush privileges;,方可立即生效
- 修改bind-address 在/etc/mysql/my.cnf中,将将”bind-address = 127.0.0.1“注释,重启mysql既可以远程访问
Subscribe to:
Posts (Atom)