直接使用Navicat通过IP连接会报各种错误,例如:Error 1130: Host '192.168.1.80' is not allowed to connect to this MySQL server. 经过个人验证,得到解决方法,如下: 授权法: 1.首先使用localhost登录到想要进行远程连接的数据库 2.打开命令提示窗口,输入如下命令: mysql> grant all privileges on *.* to 'root'@'%' identified by '1234…
直接使用Navicat通过IP连接会报各种错误,例如:Error 1130: Host '192.168.1.80' is not allowed to connect to this MySQL server. 经过个人验证,得到解决方法,如下: 授权法: 1.首先使用localhost登录到想要进行远程连接的数据库 2.打开命令提示窗口,输入如下命令: mysql> grant all privileges on *.* to 'root'@'%' identified by '123456…
根据web连接服务的原理,我们可以通过一台电脑连接我们另一台电脑上的数据库 一.开启数据库的权限1.Mysql:1)修改访问权限首先修改可以访问的ip,把‘localhost’全部修改为‘%’,打开cmd,使用指令[mysql -u root -p],进入数据库,其中root是MySQL的用户名,默认为root 2)选择数据库 3)修改ip访问的权限使用sql语句[update user set host="%" where host="localhost";]完成…
MySQL语句: SELECT GROUP_CONCAT(DISTINCT transaction_no) FROM `lm_wh_trans` GROUP BY staff_code; 如果transaction_no 在staff_code 分组下有多个不同的值的时候,将会将不同的值进行拼接上去…
mysql语句中把string类型字段转datetime类型 在mysql里面利用str_to_date()把字符串转换为日期 此处以表h_hotelcontext的Start_time和End_time字段为例,查询当前 时间在此范围之内的数据. www.2cto.com select * from h_hotelcontext where now() between STR_TO_DATE (Start_time,'%Y-%m-%d %H:%i:%s') and STR_T…