网络安装mysql:
sudo apt-get install mysql-server
网络访问mysql数据库:
sudo vi /etc/mysql/my.cnf
bind_address=127.0.0.1 ==> #bind_address=127.0.0.1 (注释掉即可)
mysql默认对表名称是区分大小写的,可以如下修改:
/etc/mysql/my.cnf 文件添加 lower_case_table_names=1 (0 区分大小写 1 忽略大小写)
查询用户权限:
use mysql
select host, user, password from user;
赋权限并立即生效:
Grant all privileges on *.* to 'root'@'%' identified by 'root' with grant option;
flash privileges;
ubuntu13.10 mysql cant restart
Stopping MySQL database server: mysqld failed!
Starting MySQL database server: mysqld already running.
解决方法:
cd /etc/mysql
cat debian.cnf
user=debian-sys-maint
password=xxxxxx
mysql -uroot -pxxxx
执行命令:GRANT ALL PRIVILEGES ON *.* TO 'debian-sys-maint'@'localhost' IDENTIFIED BY '<password>' WITH GRANT OPTION;
<password>是 debian-sys-maint 的密码