解决mysql 不能插入中文问题

(1)修改 MySql安装目录下面的my.ini(MySQL Server Instance Configuration 文件)。 设置
        default-character-set=gbk(注意,有2处)

(2)修改data目录中相应数据库目录下的db.opt配置文件
        default-character-set=gbk
        default-collation=gbk_chinese_ci
重启数据库,关闭控制台窗口重新登录数据库,执行SQL,一切正常


can't obtain database list from the server
access denied for user 'root' @ localhost

.Windows环境下:

1. 管理员登陆系统,停止mysql服务或者结束mysqld-nt进程
2. 进入命令行,来到mysql的安装目录.假设安装目录为 d://mysql// , CMD进入命令行
3. 运行 d://mysql//bin//mysqld-nt --skip-grant-tables 启动mysql,关闭权限的检查
4. 运行 d://mysql//bin//mysqladmin -u root flush-privileges password "newpassword" 重设root密码
5. 重新启动mysql服务


update user set password=password("newpassword") where host="localhost" and user="root";


E:/MySQL Server 5.0/bin>mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or /g.
Your MySQL connection id is 4
Server version: 5.0.46-enterprise-gpl-nt MySQL Enterprise Server (GPL)
Type 'help;' or '/h' for help. Type '/c' to clear the buffer.
mysql> use mysql;
Database changed
mysql> update user set password=password("password") where host="localhost" and
user="root";
Query OK, 1 row affected (0.06 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
mysql> quit
Bye
E:/MySQL Server 5.0/bin>

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值