安装了mySQL后怎么导入数据_mysql安装、配置、导入数据库

Mysql5.7.11安装- yum方式:

1、mysql官方网站下载mysql yum repo文件(rpm文件),安装后在系统/etc/yum.repo.d目录多出2个文件

2、yum search mysql

3、yum install mysql-community-server.x86_64 (mysql社区版)

新安装mysql后无root密码无法登陆问题:

1.systemctl stop mysqld.service 关闭mysql服务

2.vi /etc/my.cnf 在mysqld下面添加 skip-grant-tables,重启mysql服务systemctl start mysqld.service

3.登录mysql,mysql -u root 不用密码直接回车

4.输入update user set authentication_string=password('密码') where User='root' and Host='localhost';

5.成功后输入flush privileges;

6.exit退出mysql

7.vi /etc/my.cnf 把 skip-grant-tables 一句删除保存退出重启mysql服务

8.重新登录mysql,mysql -u root -p回车 输入你刚才填写的密码

9.登录成功后你的操作可能会出现如下两句

Your password does not satisfy the current policy requirements

You must reset your password using ALTER USER statement before executing this statement.

进入mysql执行命令:alter user 'root'@'localhost' identified by 'password'

=====================

Show databases;

Create dbname;

Use dbname;

Set names utf8;

Mysql -u root -p dbname

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值