mysql 数据库小问题

连接mysql数据库时候小问题解决

1.can't convert Fixnum into String
解决:
数据库密码写成了数字导致,只需将
password: 123456      改成  password:"123456"即可


2. 错误问题:
Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
解决:
ln -s /var/run/mysqld/mysqld.sock /tmp/mysql.sock

3. MYSQL创建utf-8格式的数据库 
GBK:
create database test2 DEFAULT CHARACTER SET gbk COLLATE gbk_chinese_ci;

UTF8:
CREATE DATABASE `test2` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;




你可能感兴趣的:(mysql,socket)