如何启动/停止/重启MySQL 一、 启动方式 1、使用 service 启动:service mysql start 2、使用 mysqld 脚本启动:/etc/inint.d/mysql start 3、使用 safe_mysqld 启动:safe_mysql 二、停止 1、使用 service 启动:service mysql stop 2、使用 mysqld 脚本启
如何启动/停止/重启MySQL
一、 启动方式
1、使用 service 启动:service mysql start
2、使用 mysqld 脚本启动:/etc/inint.d/mysql start
3、使用 safe_mysqld 启动:safe_mysql&
二、停止
1、使用 service 启动:service mysql stop
2、使用 mysqld 脚本启动:/etc/inint.d/mysql stop
3、mysqladmin shutdown
三、重启
1、使用 service 启动:service mysql restart
2、使用 mysqld 脚本启动:/etc/inint.d/mysql restart
刚开始学mysql时都是用redhat自带的。启动是什么 /rc.d/init.d/ start
这很简单,但是后来越学越多,系统自带的mysql,有的是版本太低,有的是与
自己想要装的web服务需要的低版本的mysql
后来自己学着以tar的方式安装mysql,我的mysql装在/usr/local/mysql目录下启
动碰到过很多问题。最常见的是:
ERROR 2002: Can’t connect to local MySQL server through socket
‘/tmp/mysql.sock’ (111)
解决办法:
[root@test mysql]# /usr/local/mysql/bin/mysqladmin -u root /
-S /var/lib/mysql/mysql.sock password ‘your.passwd’
或者做个连接
ln -s /var/lib/mysql/mysql.sock /tmp
其实提示找不到 /tmp/mysql.sock有时也并不是/tmp目录下没这个文件,是启动
命令不对,我碰到过
常见的几种启动方式,自己也不是记得很 清楚,如果你确定tmp下有mysql.sock这
个文件不妨试试另外的几个命令
/usr/local/mysql/bin/mysql -u root -p
/usr/local/mysql/bin/mysqld –user=mysql&
/usr/local/mysql/bin/mysqld –user=root&
/usr/local/mysql/bin/mysqld_safe –user=root&
/usr/local/mysql/bin/mysqld_safe –user=mysql&
/usr/local/mysql/bin/safe_mysqld–uer=root&(注意safe_mysqld与mysqld_safe是不同的,&表示mysql在后台运行)我的就会报错了
STOPPING server from pid file
/usr/local/mysql/data/localhost.localdomain.pid
060304 11:46:21 mysqld ended
这是权限问题,我的mysql目录属于root用户,也属于root群组,改用mysqld_safe启动就没问题了,
大家只要注意这几个mysql,safe_mysqld,mysqld_safe,mysqld,mysqladmin.多试
几次
其实有时mysql已经正 常启动了,查看mysql是否启动命令
ps -aux | grep mysqld
会看到如下类似内容
mysql 6394 0.0 1.5 10528 992 pts/3 S 16:16 0:00
/usr/local/mysql/
mysql 6395 0.0 1.5 10528 992 pts/3 S 16:16 0:00
/usr/local/mysql/
mysql 6396 0.0 1.5 10528 992 pts/3 S 16:16 0:00
/usr/local/mysql/
root 6422 0.0 1.1 2408 732 pts/3 S 16:20 0:00 grep
mysql
查看mysql是否在监 听端口命令
netstat -tl | grep mysql
会看到如下类似内容
tcp 0 0 :mysql :* LISTEN

IDLE(集成开发学习环境Integrated Development and Learning Environment)是一个 Python IDE,由 Python 语言本身编写,在 Windows 中通常作为 Python 安装 的一部分而安装。它是初学者的理想选择,使用起来很简单。对于那些正在学习 Python 的人,比如学生,它可以作为一个很好的 IDE 来开始使用。语法高亮、智能识别和自动补全等基本功能是这个 IDE 的一些特点。你可以随时在官方 文档 中了

如何在 Ubuntu 中切换多个 PHP 版本?下面本篇文章给大家介绍一下Ubuntu中切换多个 PHP 版本的方,希望对大家有所帮助!

docker内ubuntu乱码的解决办法:1、通过“locale”查看本地使用的语言环境;2、通过“locale -a”命令查看本地支持的语言环境;3、在“/etc/profile”文件的结尾处添加“export LANG=C.UTF-8”;4、重新加载“source /etc/profile”即可。

ubuntu php无法启动服务的解决办法:1、在php-fpm.conf里面设置错误日志;2、执行“/usr/sbin/php-fpm7.4 --fpm-config /etc/php/fpm/php-fpm.conf”命令;3、修改php的配置文件注释即可。

查找无用的镜像首先,您可以检查当前使用的内核,您可以通过命令获得信息:uname-aa.例如,它在我的桌面上显示为:复制代码代码如下:magc@magc-desktop:~$uname-aLinuxmagc-desktop2.6.24-19-RT#1SMPpremptRTThu8月21日02:08336003UTC2008i686GNU/Linux然后通过查看这台机器上所有内核的列表来决定哪些需要删除:运行命令:复制代码代码如下:dpkg-get-selections|greplinux例如,我

ubuntu没有php-fpm的解决办法:1、通过执行“sudo apt-get”命令添加php的源地址;2、查看有没有php7的包;3、通过“sudo apt-get install”命令安装PHP;4、修改配置监听9000端口来处理nginx的请求;5、通过“sudo service php7.2-fpm start”启动“php7.2-fpm”即可。

django的部署可以有很多方式,采用nginx+uwsgi的方式是其中比较常见的一种方式。在这种方式中,我们的通常做法是,将nginx作为服务器最前端,它将接收web的所有请求,统一管理请求。nginx把所有静态请求自己来处理(这是nginx的强项)。然后,nginx将所有非静态请求通过uwsgi传递给django,由django来进行处理,从而完成一次web请求。可见,uwsgi的作用就类似一个桥接器。起到桥梁的作用。一、安装nginxnginx是一款轻量级的web服务器/反向代理服务器及电


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),
