Mysql
2015-11-02 20:51
591 查看
mysql远程登入问题
Host is not allowed to connect to this MySQL server的解决办法
远程登入数据库的时候,出现这个错误说明服务器不让你root远程登入,必需新建一个账户,然后把你的库的权限赋给这个用户假如Database:Test
创建用户:liuyang 密码: 1234
1.进入Mysql
2.创建用户:
CREATE USER liuyang IDENTIFIED BY '1234' ;
3.分配权限:
grant insert,delete,update,select,drop,create,alter on Test.* to liuyang @"%" identified by "1234";
GRANT ALL ON picture.* TO test IDENTIFIED BY "test";
登入指令:
mysql -uliuyang -p1234 -h14.215.177.38 -p3306Warning: Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user 'guang_wifi'@'59.33.112.18' (using pa
ssword: YES)
//调整一下顺序就可以了
mysql -h14.215.177.38 -p3306 -uliuyang -p1234
mysql修改密码:
方法一:没有登入mysql
mysqladmin -u用户名 -p旧密码 password 新密码mysqladmin -u用户名 -p password 新密码
c:\mysql\bin>mysqladmin -uroot password "your old password"
enter new pwd
confim new pwd
当看到:Warning: Using a password on the command line interface can be insecure. 已经修改完成
方法二:登入mysql
mysql>use mysql#新版本使用:
mysql>update user set authentication_string=password('1234') where User='root'; //password(1234) /('字符')
#老版本使用:
mysql>update user set password=password(1234) where User='liuyang'; //password(1234) /('字符')
#刷新权限
flush privileges;
//重新加载权限表
方法三:跳过登入
在mysql的my.ini 配置文件中添加一行:skip-grant-tables重启mysql
1. 服务 services.msc 2. net start mysql 3. net stop mysql
直接不用密码登入,执行方法二 ,修改 user='root'
mysql绿色安装:
1.oracle官网下载mysql zip包
2.解压,新建data文件夹(空),复制配置文件,进行配置
# For advice on how to change settings please see # http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html # *** DO NOT EDIT THIS FILE. It's a template which will be copied to the # *** default location during install, and will be replaced if you # *** upgrade to a newer version of MySQL. [mysqld] #skip-grant-tables # Remove leading # and set to the amount of RAM for the most important data # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%. # innodb_buffer_pool_size = 128M # Remove leading # to turn on a very important data integrity option: logging # changes to the binary log between backups. # log_bin # These are commonly set, remove the # and set as required. # basedir = ..... # datadir = ..... # port = ..... # server_id = ..... basedir ="F:\develpment\mysql\mysql-5.7.13-winx64" datadir ="F:\develpment\mysql\mysql-5.7.13-winx64\data" # Remove leading # to set options mainly useful for reporting servers. # The server defaults are faster for transactions and fast SELECTs. # Adjust sizes as needed, experiment to find the optimal values. # join_buffer_size = 128M # sort_buffer_size = 2M # read_rnd_buffer_size = 2M sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES #服务端的编码方式 character-set-server=utf8 [client] #客户端编码方式,最好和服务端保存一致 loose-default-character-set=utf8 [WinMySQLadmin] Server = "F:\develpment\mysql\mysql-5.7.13-winx64\bin\mysqld.exe"
3.新建服务
cmd 中 cd到 mysql/bin 指令:1) 使用-initialize生成随机密码,由于自己学习,使用-initialize-insecure生成空密码。默认帐号root,后面的-user=mysql不更改(新建的data必须空,很重要!!!):”
mysqld --initialize-insecure --user=mysql
2)安装服务
mysqld -install (卸载服务: mysqld -remove)
3)开启服务
services.msc 找到mysql服务,点击开启
4)登入mysql
相关文章推荐
- centos7服务器配置文档
- MySQL两种安装方式02(绿色安装)_day02
- centos7服务器配置文档
- 关于hibernate链接MySQL时,存储中文出现乱码
- mysql安装下载配置
- 导出mysql数据,利用pandas生成excel文档,并发送邮件
- 导出mysql数据,利用pandas生成excel文档,并发送邮件
- ubuntu安装mysql5.5
- mysql让count为0的记录也显示出来
- 在设置MySQL时,应该配置其使用静态
- 普通的MySQL用户利用表创建和索引操作
- rhel6.4 安装 mysql-5.6
- rhel6.4 安装 mysql-5.6
- mysql库级别结构和指定行数数据导出
- Excel文件导入Mysql
- hive metadata 存mysql 注释中文乱码的问题
- MySQL数据同步(一主多从)
- Mysql的一些最基本命令
- MYSQL的基本使用【表的创建和修改、视图、函数、存储过程、触发器和事件调度器】
- MYSQL的基本使用【表的创建和修改、视图、函数、存储过程、触发器和事件调度器】