阿小信大人的头像
Where there is a Python, there is a way. 阿小信大人

centOS安装mysql2015-09-24 18:11

####安装mysql

下载

sudo rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
sudo yum install mysql-server
service mysql stop
mysqld_safe --skip-grant-tables &
mysql -u root
> use mysql;
> update user set password=PASSWORD("NEW-ROOT-PASSWORD

......
#Linux/Mac#   #mysql 评论[0]阅读全文[1306]

登录远程MySQL报错解决办法2014-09-03 02:56

登录远程mysql:`$ mysql -uroot -h192.168.137.108 -p`

报错:

ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.137.108' (111)

解决办法:注释掉/etc/mysql/my.cnf的bind-address = 127.0.0.1

报错:

ERROR 1130 (HY000): Host '192.168.137.108' is not allowed to connect to this MySQL ser

......
#数据库#   #mysql 评论[0]阅读全文[1154]

将sqlite3的数据导入mysql中2014-09-02 04:43

导出数据:

ashin@linux:~$ sqlite3 ~/geek/iamnotdbfile .dump > geek.sql

删除前两行和最后一行:

PRAGMA foreign_keys=OFF;

BEGIN TRANSACTION;

...

COMMIT;

ashin@linux:~$ sed -i '1,2d; $d' geek.sql

将sqlite的"换成mysql的`:

ashin@linux:~$ sed 's/"/`/g' geek.sql > geek1.sql

加上mys

......
#数据库#   #mysql #sqlite3 评论[2]阅读全文[1651]

MySQL笔记2014-09-02 04:42

安装MySQL

sudo apt-get install mysql-server
sudo apt-get install mysql-workbench

安装MySQLdb:

pip install MySQL-python

报错找不到config文件:

sudo apt-get install libmysqld-dev


Linux mysql5.5.18设置编码

应该在my.cnf的[mysqld]下添加 character-set-server = utf8

charact

......
#数据库#   #mysql 评论[0]阅读全文[1145]