启动mysql服务:/usr/sbin/mysqld
进入本地mysql查看:mysql –u root –p password
mysql> show databases
mysql> use `testTable`
mysql>
show tables
设置远程能访问
mysql> GRANT ALL PRIVILEGES ON *.* TO root@’%’ IDENTIFIED BY ‘password’ WITH GRANT OPTION;
mysql> commit;
mysql> flush privileges; (刷新权限)
设置远程能访问
netstat -an | grep 3306
进入到mysql的配置文件所在目录(/etc/mysql/my.cnf)找到文件中如下内容:
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address
将bind-address注释掉,或者改成客户端主机IP