#在[mysqld]中添加:

datadir = /usr/local/mysql/data         #添加

log-error = /usr/local/mysql/data/error.log  #添加

#pid-file = /usr/local/mysql/data/mysql.pid   #注释掉

tmpdir = /var/tmp #不建议放在/tmp下

我先说一下我安装mysql的操作吧:

1、开始的时候,安装mysql,是那种解压缩就能用的软件包。我把它解压后,拷贝到/usr/local/ 目录下,并把名字命名为mysql。

2、建立用户mysql。[root@localhost ~]# useradd mysql

3、修改权限。[root@localhost ~]# chown -R mysql:mysql /usr/local/mysql

4、初始化mysql。进入/usr/local/mysql目录下的/usr/local/mysql/scripts/目录,有个mysql_install_db可执行文件。运行/usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data &(这点非常重要)

不运行红色字体的,可能会出现错误:

FATAL ERROR: Could not find ./bin/my_print_defaults
If you compiled from source, you need to run 'make install' to
copy the software into the correct location ready for operation.
If you are using a binary release, you must either be at the top
level of the extracted archive, or pass the --basedir option
pointing to that location.

5、启动mysql服务。运行[root@localhost ~]# /usr/local/mysql/bin/mysqld_safe

120223 21:42:59 mysqld_safe Logging to '/usr/local/mysql/data/localhost.localdomain.err'. 
chown: “/usr/local/mysql/data/localhost.localdomain.err” 后缺少操作数 
请尝试执行“chown --help”来获取更多信息。 
120223 21:42:59 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data

出现类似的提示说明启动成功

主意:可能会出现这个错误

mysqldump: error while loading shared libraries: libmysqlclient.so.16: cannot open shared object file: No such file or directory

解决方案就是:

1、先查找libmysqlclient.so.16文件存在否。

[root@localhost ~]# find \ –name libmysqlclient.so.16

2、若存在。建立软连接。

ln -s /usr/local/mysql/lib/libmysqlclient.so.16 /usr/lib/ 主意:若系统是64bit的,则是:

ln -s /usr/local/mysql/lib/libmysqlclient.so.16 /usr/lib64/

其实说了这么多还没有说到我需要说的问题。

不知怎么的,我安装的mysql在/etc/下没有my.cnf文件。

由于测试需要,故拷贝了一个my.cnf文件。然后再启动,报这个问题。

[root@localhost ~]# /usr/local/mysql/bin/mysqld_safe 
120223 21:29:59 mysqld_safe Logging to '/usr/local/mysql/data/localhost.localdomain.err'. 
chown: “/usr/local/mysql/data/localhost.localdomain.err” 后缺少操作数 
请尝试执行“chown --help”来获取更多信息。 
120223 21:29:59 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data 
120223 21:29:59 mysqld_safe mysqld from pid file /usr/local/mysql/data/localhost.localdomain.pid ended

----------------------------------

关于mysql启动问题---mysqld_safe mysqld from pid file * ended的更多相关文章

  1. [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist 160913 02:11:21 mysqld_safe mysqld from pid file /tmp/mysql.pid ended

    -- :: [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0 -- :: [Warning] InnoDB: New ...

  2. linux下安装mysql问题总结(一)mysqld_safe mysqld from pid file /usr/local/mysql/data/mysql.pid ended

    linux下安装mysql数据库 linux版本:CentOS release 6.8 (Final) mysql版本:mysql-5.7.16-linux-glibc2.5-x86_64.tar.g ...

  3. Mysql启动失败 MYSQL:The server quit without updating PID file

    MySQL5.6启动时出错 提示MYSQL:The server quit without updating PID file 首先执行 /bin/mysqld_safe --user=mysql & ...

  4. mysql启动失败:不能创建pid文件

    2016-03-09T07:51:38.905444Z 0 [ERROR] /usr/sbin/mysqld: Can't create/write to file '/var/run/mysqld/ ...

  5. mysqld_safe error: log-error set to '/data/log/mysqld.log', however file don't exists. Create writable for user 'mysql'.The server quit without updating PID file (/data/mysql/mysqld.pid)

    [oot@cent65 bin]# service mysqld startStarting MySQL.2019-10-28T15:56:47.786960Z mysqld_safe error: ...

  6. mysql启动报错:Starting MySQL...The server quit without updating PID file

    在mysql的data目录下误删除了mysql-bin.000001,mysql-bin.000002等文件,但是没有删除mysql-bin.index文件,此时启动mysql就会报错: Starti ...

  7. Starting MySQL.The server quit without updating PID file (xxxx.pid).[FAILED]

    mysql无法正常启动,查看日志报如下异常 --07T01::.929615Z [ERROR] Fatal error: Please read "Security" sectio ...

  8. Starting MySQL...The server quit without updating PID file

    修改mysql的配置文件(my.cnf)后,再启动mysqld的时候报错: # service mysqld start Starting MySQL...The server quit withou ...

  9. Starting MySQL....The server quit without updating PID file[失败]/lib/mysql/ip12189.pid). 错误一例

    [root@ip12189 etc]# service mysqld startStarting MySQL....The server quit without updating PID file[ ...

随机推荐

  1. (转)正则表达式与Python(RE)模块

    Python正则表达式指南  原文:http://blog.csdn.net/qdx411324962/article/details/46799831 Python3(2):正则表达式与Python ...

  2. dubbo序列化hibernate.LazyInitializationException could not initialize proxy - no Session懒加载异常的解决

    dubbo序列化,hibernate.LazyInitializationException could not initialize proxy - no Session懒加载异常的解决 转载声明: ...

  3. IO流(一)字节流

    1:io流体系:对数据进行读写操作.所以IO不是读就是写咯. 2:io流的相关的类:java.io包. 有关IO的操作都会产生IOException异常 3:io:参照物是程序, i:input.进来 ...

  4. Mac OS terminal终端常用命令

    基础概念 OS X 采用的Unix文件系统,所有文件都挂在跟目录“ /” 下面,所以不在要有Windows 下的盘符概念.比如什么“C:”你在桌面上看到的硬盘都挂在 /Volumes 下.比如接上个叫 ...

  5. 【Lua】Lua + openresty遍历文件目录

    OpenResty (也称为 ngx_openresty)是一个全功能的 Web 应用服务器,它打包了标准的 Nginx 核心,很多的常用的第三方模块,以及它们的大多数依赖项. 今天用OpenRest ...

  6. 【ExtJS】关于标准模块化封装组件

    在此之前,自己封装自定义控件用的是这样的方式: Ext.define('My.XXX',{ extend: 'Ext.YYY', xtype: 'ZZZ', . . . items:[ ... ] } ...

  7. Ubuntu下伪分布式模式Hadoop的安装及配置

    1.Hadoop运行模式Hadoop有三种运行模式,分别如下:单机(非分布式)模式伪分布式(用不同进程模仿分布式运行中的各类节点)模式完全分布式模式注:前两种可以在单机运行,最后一种用于真实的集群环境 ...

  8. UEditor编辑器 字符数统计和字符数限制 问题

    1.百度UEditor修改右下角统计字数默认只统计前台所见的文字个数,为了便于展示实际保存的时候是保存的包含html标签的,所以右下角的统计字数功能需要修改 getContentLength: fun ...

  9. 在打印窗口,打印视图View的子视图结构图

    在打印窗口,打印视图View的子视图结构图,使用 po [self.view recursiveDescription];

  10. javascript进行base64加密,解密

    function Base64() { // private property _keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqr ...