远程不能连接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
这样就可以了
相关文档:
环境: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 ......
using System;
using System.Data;
using System.Diagnostics;
using System.Collections.Generic;
using MySql.Data.MySqlClient;
namespace System
{
/// <summary>
/// Description of MySqlDBUtil.
/// </summary>
public class MySqlDBUtil
{
&nbs ......
DROP PROCEDURE IF exists pro_removeBillRemindByUserId;
create procedure pro_removeBillRemindByUserId(userId int)
begin
declare ts varchar(500);
declare cnt int default 0;
declare f_ID,b int;
DECLARE cur_1 CURSOR ......
MySQL安装指南
要安装 MySQL,可以在终端提示符后运行下列命令:
sudo apt-get install mysql-server
sudo apt-get install mysql-client
sudo apt-get install php5-mysql
// 安装php5-mysql 是将php和mysql连接起来
一旦安装完成,MySQL 服务器应该自动启动。您可以在终端提示符后运行以下命令来检查 MySQL 服务 ......
本示例通过 while...end while 循环控制游标来实现插入表记录。
DROP PROCEDURE IF exists pro_initCategoryForTradingEntity;
create procedure pro_initCategoryForTradingEntity(tradingEntityId int)
begin
declare f_parent,entityId int;
declare b int default 0; ......