#在[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. selenium+Python(定位 单选、复选框,多层定位)

    1.定位一组元素webdriver 可以很方便的使用 findElement 方法来定位某个特定的对象,不过有时候我们却需要定位一组对象,这时候就需要使用 findElements 方法.定位一组对象 ...

  2. D3介绍

    D3介绍 D3是用来做web页面可视化的组件,其官方网址为http://d3js.org 安装 D3类库的文件只有一个d3.js.下载后直接在html的<script>标签中引用此js就可 ...

  3. Learning Linux Commands: awk--reference

    http://how-to.linuxcareer.com/learning-linux-commands-awk 1. Introduction In this case, the title mi ...

  4. 持续集成工具TeamCity配置使用

    持续集成CI(Continuous Integration)主要包括自动化的编译.发布和测试集成,对于我们信息系统项目开发非常有用.一般开发人员机器上会搭建自己的开发环境,整个项目在服务器上会搭建测试 ...

  5. .netCore2.0 配置文件

    之前的asp.net 的配置文件都是xml格式,而.netCore的配置文件则采用Json键值对的格式来存储,具体获取如下 var config = new ConfigurationBuilder( ...

  6. MVC-cshtml(条件编译已关闭)

    加单引号    

  7. 前端标注软件-pxcook像素大厨使用心得

    我们在日常开发过程中,设计师给提供的UI图,经常需要标注尺寸,有时候设计师难免会遗漏标注,这样就会大大的增加我们的沟通成本,因此,使用一款好用的标注软件就尤为重要,我推荐这款标注软件---pxcook ...

  8. python--boto3 之 与dynamoDB 的基本交互,表的备份与恢复

    最近因工作需要,研究了一下boto3中dynamoDB部分,略有心得,在此总结一下. 首先是boto3的安装,在装有python和pip的机器上,运行 sudo pip install boto3 官 ...

  9. UNION ALL 视图 'ImprotHIS2012.dbo.ImportHISData' 不可更新,因为没有找到分区依据列。 Severity 16 State 12

    -- 3 更正措施,使约束check一次 Alter Table ImprotHIS_Bak_2011.dbo.ImportHISData with check Check Constraint al ...

  10. es6 import笔记

    export输出: // profile.js var firstName = 'Michael'; var lastName = 'Jackson'; var year = 1958; export ...