易截截图软件、单文件、免安装、纯绿色、仅160KB

mysql 远程 ip访问


默认情况下Linux内的mysql数据库mysql,user表内的用户权限只是对localhost即本机才能登陆。需要更改权限:
如下的方式确认:
root#mysql -h localhost-u mysql -p 
Enter password:    ******
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4 to server version: 4.0.20a-debug
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> use mysql;   (此DB存放MySQL的各种配置信息)
Database changed
mysql> select host,user from user; (查看用户的权限情况)
+-------------+-------+
| host            | user    |
+-------------+-------+
| localhost      |           |
| localhost      | root   |
| localhost      |           |
| localhost      | mysql |
+-------------+-------+
6 rows in set (0.02 sec)
由此可以看出,只能以localhost的主机方式访问。
解决方法:
mysql> Grant all privileges on *.* to 'root'@'%' identified by ‘password’with grant option;
(%表示是所有的外部机器,如果指定某一台机,就将%改为相应的机器名;‘root’则是指要使用的用户名,)
mysql> flush privileges;  (运行为句才生效,或者重启MySQL)
Query OK, 0 rows affected (0.03 sec)
mysql> select host,user from user; (再次查看用户的权限情况)
+-------------+-------+
| host            | user    |
+-------------+-------+
| %                 | mysql |
| %                 | root   |
| localhost  


相关文档:

mysql 乱码处理

 1. mysqldump -u username -h somehost -p --compatible=mysql40 db_name > temp.sql
  2. 用phpmyadmin清空数据库并设置数据库整理为utf8_general_ci
  3. mysql -u username -h somehost -p --default-character-set=utf8 db_name < temp.sql ......

mysql 数据库卸载不完全,配置出错解决办法

The security settings could not be applied to the database because the connection has failed with the following error.
Error Nr. 2003
Can't connect to MySQL server on 'localhost' (10061)
If a personal firewall is running on your machine, please make sure you have opened the TCP port 3306 for conn ......

Navicat for MySQL与MySQL GUI Tools比较

前言
  MySQL GUI工具很多,本文就常用的Navicat for MySQL与MySQL GUI Tools的特色功能做一个详细介绍与比较。
  (一)MySQL GUI Tools
  MySQL官方提供的一个可视化界面的MySQL数据库管理控制台,提供了四个图形化应用程序,这些图形化管理工具可以大大提高数据库管理、备份、迁移和查询效率。它们分别是: ......

MySQL show的用法

a. show tables或show tables from database_name; // 显示当前数据库中所有表的名称
   b. show databases; // 显示mysql中所有数据库的名称
   c. show columns from table_name from database_name; 或show columns from database_name.table_name;   // 显示表中列名称
   ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号