启动mysql时报错的解决(mysql 5.0.45 redhat as 43)

启动mysql时报错的解决(mysql 5.0.45 redhat as 43),第1张

启动mysql时报错的解决(mysql 5.0.45 redhat as 43)

启动mysql时报错:

Starting mysqld daemon with databases from /var/lib/mysql

STOPPING server from pid file /var/run/mysqld/mysqld.pid

071112 00:22:06 mysqld ended

查看日志:

#less /var/log/mysqld.log

其中有一段如下:

071112 0:22:06 [ERROR] /usr/local/mysql/bin/mysqld: Can't create/write to file '/var/run/mysqld/mysqld.pid' (Errcode: 2)

071112 0:22:06 [ERROR] Can't start server: can't create PID file: No such file or directory

071112 00:22:06 mysqld ended

#cd /var/run/

#ls

mysqld目录不存在,创建它:

#mkdir /var/run/mysqld

#cd /var/run/mysqld

创建文件mysqld.pid:

#touch mysqld.pid

#cd..

#chown -R mysql mysqld .

#cd /usr/local/mysql/

#bin/mysqld_safe --user=mysql &

nohup: ignoring input and redirecting stderr to stdout

Starting mysqld daemon with databases from /var/lib/mysql

能正常启动

#bin/mysqladmin -u root password root

又出错

[root@localhost mysql]# bin/mysqladmin -u root password root

bin/mysqladmin: connect to server at 'localhost' failed

error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'

Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists!

[root@localhost mysql]# bin/mysql -u root -p

Enter password:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

分析:是/tmp/mysql.sock 不存在

# cd /var/lib/mysql/

由于mysql 默认的mysql.sock 是在/var/lib/mysql/mysql.sock,创建符号连接:

# ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock

# bin/mysql -u root

Welcome to the MySQL monitor. Commands end with or g.

Your MySQL connection id is 1

Server version: 5.0.45 MySQL Community Server (GPL)

Type 'help' or 'h' for help. Type 'c' to clear the buffer.

mysql>

修改root 密码

#cd /usr/local/mysql/

#bin/mysqladmin -u root -p password yourpassword

Oracle DBA神器:PRM-DUL灾难恢复工具可以直接从这种受损的Oracle数据库中将数据拯救出来。

你的数据库因为ORA-00600/ORA-07445或其他ORA-报错,或丢失关键的system表空间数据文件,或ASM diskgroup损坏时均可以考虑采用PRM-DUL来做恢复。PRM-DUL采用独创的DataBridge恢复技术,直接从数据文件中抽取数据后可以像DBLINK那样直接插入到新建数据库中,而无需数据落地成为DMP文件占用空间。

数据库错误:1064就是语法错误。

注意查看你的sql语句,将报错的行中,多检查几遍,都能检查出来问题所在的。平时写SQL语句时,细心点,都能大大减少这种错误的发生频率。


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/sjk/10711212.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-10
下一篇 2023-05-10

发表评论

登录后才能评论

评论列表(0条)

保存