远程不能连接mysql解决方法
远程连接另一台电脑的mysql的数据库时,如果连接不上,这时候就要在被连接的电脑上执行以下命令:
原因:是没有给登录用户名设置远程主机登录的权限
1。登录mysql :
执行:mysql -u root -p
2。修改 MySQL 数据库中 user 表中 对应用户名的 Host 字段,将 localhost 改为 %
执行:use mysql;
再执行:update user set Host = '%' where User = 'username';
然后重启:sudo /etc/init.d/mysql restart
这样就可以了
相关文档:
##/etc/my.cnf:
# [mysql]
# default-character-set=utf8
# [mysqld]
# character-set-server=utf8
# collation-server=utf8_general_ci
# [client]
# default-character-set=utf8
/etc/init.d/mysqld stop
/etc/init.d/mysqld start
# dump db
mysqldump -u dbuser -pdbpass --opt --skip-set-charset --defaul ......
mysql数据库备份与还原命令:
备份:
如我们需要把 数据库名为:shopping 的数据库备份: 用户名为:root,密码为:12345,那么命令如下:
直接进入dos,如果没有配置mysql的环境变量,那么需要把dos的当前目录切换到mysql的bin目录下,然后敲入一下命令:
mysqldump -uroo ......
环境:CentOS linux 5.2
系统只安装VI编辑器与开发工具
在编辑MYSQL时:
#./configure --prefix=/usr/local/mysql --with-charset=gb2312 --with-extra-charsets=all
执行后出现如下错误:
checking for tgetent in -ltermcap… no
checking for termcap functions library… config ......
最近因为忘了mysql的root密码,上网Google一下,现在把步骤记一下,防止以后忘了。
我用的是xampp软件包。
1. 停止mysql
2. 打开cmd,切换目录到 \xampp\mysql\bin, 运行
mysqld -skip-grant-tables
这条命令是跳过权限检查启动mysql服务
3. 打开另一个cmd,同样切换目 ......
Mysql 分区相关资源
http://www.bigheaddba.net/article/y2009/339_mysql%E5%88%86%E5%8C%BA%E8%A1%A8%E5%B1%80%E9%99%90%E6%80%A7%E6%80%BB%E7%BB%93.html
http://www.ooso.net/archives/217
http://dev.mysql.com/doc/refman/5.1/zh/partitioning.html#partitioning-range
http://hi.baidu.com/zhangguanshi/blog/i ......