首页 / MYSQL / mysql配置开机启动
mysql配置开机启动
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了mysql配置开机启动,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1830字,纯文字阅读大概需要3分钟。
内容图文
![mysql配置开机启动](/upload/InfoBanner/zyjiaocheng/1061/d471104678d646369bb178585176a930.jpg)
昨天初始化mysql数据库,今天开机进行相关调优、配置
首先查看到mysql开机没有
[root@dataserver ~]# ss -lntup|grep mysql
配置/etc/rc.local 将mysql设置为开机启动
方法一、
[root@dataserver ~]# vim /etc/rc.local
#!/bin/sh # # This script will be executed *after* all the other init scripts. # You can put your own initialization stuff in here if you don‘t # want to do the full Sys V style init stuff. touch /var/lock/subsys/local /etc/init.d/mysqld start ~ ~ ~ ~ "/etc/rc.local" 8L, 245C 已写入 [root@dataserver ~]# reboot [root@dataserver ~]# ss -lntup|grep mysql tcp LISTEN 0 50 *:3306 *:* users:(("mysqld",1459,10))
方法二、
[root@dataserver ~]chkconfig --add mysqld
[root@dataserver ~]chkconfig mysqld on
[root@dataserver ~]reboot
重启查看是否生效
[root@dataserver ~]# reboot
Broadcast message from root@dataserver
(/dev/pts/1) at 5:26 ...
The system is going down for reboot NOW!
[root@dataserver ~]#
Last login: Wed Sep 27 05:21:53 2017 from 192.168.3.3
[root@dataserver ~]# ss -lntup|grep mysql
tcp LISTEN 0 50 *:3306 *:* users:(("mysqld",1459,10))
[root@dataserver ~]# mysql -uroot -pdongliqiang
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.5.32 Source distribution
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| dongliqiang |
| mysql |
| performance_schema |
| test |
+--------------------+
5 rows in set (0.06 sec)
开机启动还有其他种方法,大家自行尝试,掌握最常用的集中就行了
本文出自 “董利强” 博客,请务必保留此出处http://6207422.blog.51cto.com/6197422/1968970
原文:http://6207422.blog.51cto.com/6197422/1968970
内容总结
以上是互联网集市为您收集整理的mysql配置开机启动全部内容,希望文章能够帮你解决mysql配置开机启动所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。