Mysql的安装配置
Mac上
- mysql下载 : https://dev.mysql.com/downloads/mysql/
- mysql升级:https://askubuntu.com/questions/750498/mysql-5-5-update-to-mysql-5-7
配置Path
echo 'export PATH=$PATH:/usr/local/mysql/bin' >> ~/.bash_profile
source ~/.bash_profile
修改root密码
$ mysql -u root -p
SET PASSWORD = PASSWORD('xxxxx');
或 SET PASSWORD FOR 'root'@'localhost' = PASSWORD('xxxxx');
或 ALTER USER 'root'@'localhost' IDENTIFIED BY 'xxxxx';
添加数据库
create database db_user character set UTF8 collate utf8_unicode_ci;
为指定数据库添加权限
GRANT ALL ON <local database name>.* TO <remote web node username>@<remote web node server ip address> IDENTIFIED BY '<database user password>';
GRANT ALL ON db_user.* TO 'luowei'@'%' IDENTIFIED BY 'xxxxxxxxxxx';
Ubuntu 安装 mysql-python 出现 “mysql_config not found”
sudo apt-get install libmysqlclient-dev
然后进入mysql_config的路径(/usr/bin/mysql_config)
sudo updatedb
locate mysql_config