常用命令:

service mysql start

service mysql stop

service mysql restart

登录mysql

/www/lnmp/mysql/bin/mysql -u root -p

创建数据库

create database test;

创建一个用户test_a对test数据库有使用权并有远程访问权限

grant all privileges on test.* to 'test_a'@'%' identified by '密码' with grant option;

刷新权限

flush privileges;

离开

\q

初始安装配置

cd /www/lnmp/mysql

安装数据

./scripts/mysql_install_db --user=mysql

service mysql start

启动初始配置向导

./bin/mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL

SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MySQL to secure it, we'll need the current

password for the root user.  If you've just installed MySQL, and

you haven't set the root password yet, the password will be blank,

so you should just press enter here.

Enter current password for root (enter for none):

第一次安装直接回车,还没有设置密码

OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MySQL

root user without the proper authorisation.

Set root password? [Y/n]

输入y然后设置密码

By default, a MySQL installation has an anonymous user, allowing anyone

to log into MySQL without having to have a user account created for

them.  This is intended only for testing, and to make the installation

go a bit smoother.  You should remove them before moving into a

production environment.

Remove anonymous users? [Y/n]

删除匿名用户,Y

Normally, root should only be allowed to connect from 'localhost'.  This

ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n]

禁止根远程登录,Y

By default, MySQL comes with a database named 'test' that anyone can

access.  This is also intended only for testing, and should be removed

before moving into a production environment.

Remove test database and access to it? [Y/n]

删除测试数据库,Y

Reloading the privilege tables will ensure that all changes made so far

will take effect immediately.

Reload privilege tables now? [Y/n]

刷新权限,Y

All done!  If you've completed all of the above steps, your MySQL

installation should now be secure.

Thanks for using MySQL!

感谢您使用MySQL!配置完成

mysql初始设置_三 mysql 初始配置相关推荐

  1. mysql字符集设置方案_MySQL的字符集配置

    utf8的锅: 场景 : 之前在给客户做微商城时,需要保存微信的授权信息,此时就有一个nickname字段,在设计数据表时,潜意识的将表的存储格式设置为utf8,生产上线一段时间后偶尔出现保存异常.经 ...

  2. mysql关于时间的面试题,mysql时间设置默认值MySQL常见面试题

    1.limit(选出10 到20 条) select * from students order by id limit 9,10; 2.MySQL 会使用索引的操作符号 =,>,=,betwe ...

  3. 360 mysql无法启动_安装MySQL 5后无法启动(不能Start service)解决方法小结

    转自:http://www.jb51.net/article/33375.htm 创建primay key过程中发生了断电,当电脑再次启动时候,发现mysql 服务无法启动,使用 net start ...

  4. MySQL学习笔记_关于MySQL的字符类型VARCHAR长度知识总结

    MySQL学习笔记_关于MySQL的字符类型VARCHAR长度知识总结 一.VARCHAR存储和行长度限制 1.VARCHAR(N)中,N指的是字符的长度,VARCHAR类型最大支持65535,指的是 ...

  5. mysql 多实例 独立配置文件_三、安装配置多实例MYSQL5.6-多独立配置文件方法

    三.安装配置多实例MYSQL5.6-多独立配置文件方法 1.准备工作 检查操作系统版本.内核版本.selinux是否关闭.防火墙策略.IP地址.主机名配置.host表配置.yum配置 上传cmake. ...

  6. mysql 存json中文乱码怎么设置_解决 MySQL 中文乱码

    想要解决MySQL中文乱码首先必须了解下MySQL所支持的字符集,至于中文乱码出现的原因可以总结为:向数据库中插入的数据与数据库中的表所使用的字符集编码不同 一 . MySQL 中文字符集 常见支持中 ...

  7. mysql路由器配置文件_如何安装并配置mysql 5.7.13解压缩版?

    如何安装并配置mysql 5.7.13解压缩版? MySQL是一个关系型数据库管理系统,官方网站是http://www.mysql.com/,分为MySQL Enterprise Edition(co ...

  8. mysql 无线网络设置_操作mysql命令行的方法步骤

    操作mysql命令行的方法步骤 现在向大家介绍mysql命令行下,从数据库的建立到表数据的删除全过程,希望对大家有所帮助. 登陆mysql 打cmd命令终端,如果已经添加了mysql的环境变量,可以直 ...

  9. 删除+mysql+用户密码_误删除mysql中的所用用户,如何重新设置root账号和密码

    在练习mysql语句的时候,使用delete将数据库中的所有用户删除了,其中也包括root用户.并进行了flush privileges:这时候发现重新登入mysql已经不能正常登陆.对此我们要重新设 ...

最新文章

  1. 2020互联网公司中秋礼盒大比拼!(文末送福利)
  2. 阻塞io阻塞io_Redis:RESP协议,阻塞IO 与非阻塞IO,Redis的线程模型
  3. Partition--分区总结
  4. Oracle案例:index range scan真的不会多块读吗?
  5. 小米崔宝秋:一家互联网公司没有信息安全团队,就像在“裸奔”!
  6. oracle数据库查询下级_Oracle 图技术
  7. git 代码行数统计
  8. 青岛阳光计算机学校,青岛恒星科技学院
  9. ERROR: No matching distribution found for xxx
  10. 微信移动学习平台小程序 后台基于php+mysql
  11. 开篮球馆需要什么_建立一个篮球馆需要什么!
  12. PX4 Position_Control RC_Remoter引入
  13. python创建函数内部静态变量
  14. VRRPv2和VRRPv3对比区别
  15. tomcat HTTP与HTTPS同时开启并且同时可以访问
  16. 从秋香,芳娜到不嫁国人的女大学生
  17. 大三学生的2018年总结
  18. 0元0基础搭建个人网站简易实操
  19. c语言开发exporter,prometheus数据采集exporter全家桶
  20. 2. 算法 (图灵机到底是个啥 ?)

热门文章

  1. html数组删除指定元素,js怎么删除数组中指定元素?
  2. 4个方法,快速提升抖音作品推荐量
  3. 自定义Fx控件的捷径
  4. SpringBoot调用第三方IP查询接口(Https)
  5. slash php,Slash音色完美诠释
  6. 90%企业在探索的敏捷开发怎么做?极狐GitLab总结了这些逻辑与流程
  7. Mybatis-plus分页查询records为空,total不为空的问题
  8. 谈谈如何设计好网站的URL
  9. css中盒子的属性,css盒子模型及属性介绍
  10. 单片机在微型计算机系统中的作用,单片机原理及应用习题及答案