装MYSQL时遇到的错误归档(随时更新)

本文涉及的产品
云数据库 RDS MySQL Serverless,0.5-2RCU 50GB
简介:
今天我升级MYSQL到5.1的时候遇到的。写出来共享以下。
1
[root@localhost mysql]# scripts/mysql_install_db 
Neither host 'localhost.localdomain' nor 'localhost' could be looked up with
/resolveip
Please configure the 'hostname' command to return a correct
hostname.
If you want to solve this at a later stage, restart this script
with the --force option

这个主要是修改/etc/hosts文件
echo "127.0.0.1 localhost.localdomain localhost" >> /etc/hosts

然后再初始化数据,如果还是同样的错误,那就直接加--force开关。
我今天碰到的就是这个情况。

[root@localhost mysql]# scripts/mysql_install_db --force
Installing MySQL system tables...
OK
Filling help tables...
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/local/mysql//bin/mysqladmin -u root password 'new-password'
/usr/local/mysql//bin/mysqladmin -u root -h localhost.localdomain password 'new-password'
See the manual for more instructions.
You can start the MySQL daemon with:
cd . ; /usr/local/mysql//bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd mysql-test ; perl mysql-test-run.pl

Please report any problems with the ./bin/mysqlbug script!

The latest information about MySQL is available on the web at
[url]http://www.mysql.com[/url]
Support MySQL by buying support/licenses at [url]http://shop.mysql.com[/url]
这样就成功初始化数据了。
2、编码文件链接丢失。

[root@localhost mysql]# scripts/mysql_install_db --force
Installing MySQL system tables...
071129 13:38:08 [ERROR] Can't find messagefile '/usr/local/mysql/share/english/errmsg.sys'
071129 13:38:08 [ERROR] Aborting

071129 13:38:08 [Note] 
Installation of system tables failed!

Examine the logs in /usr/local/mysql/data/ for more information.
You can try to start the mysqld daemon with:
/usr/local/mysql//bin/mysqld --skip-grant &
and use the command line tool
/usr/local/mysql//bin/mysql to connect to the mysql
database and look at the grant tables:

shell> /usr/local/mysql//bin/mysql -u root mysql
mysql> show tables

Try 'mysqld --help' if you have problems with paths. Using --log
gives you a log in /usr/local/mysql/data/ that may be helpful.

The latest information about MySQL is available on the web at
[url]http://www.mysql.com[/url]
Please consult the MySQL manual section: 'Problems running mysql_install_db',
and the manual section that describes problems on your OS.
Another information source is the MySQL email archive.
Please check all of the above before mailing us!
And if you do mail us, you MUST use the ./bin/mysqlbug script!

解决:
今天发现MYSQL官方5.1.22 对这个BUG进行了修正。
mysql_install_db could fail to find its message file. (
Bug#30678 )
[root@localhost mysql]# ln -s /usr/local/mysql/share/mysql/english/ /usr/local/mysql/share/english
[root@localhost mysql]# scripts/mysql_install_db --force
Installing MySQL system tables...
OK
Filling help tables...
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/local/mysql//bin/mysqladmin -u root password 'new-password'
/usr/local/mysql//bin/mysqladmin -u root -h localhost.localdomain password 'new-password'
See the manual for more instructions.
You can start the MySQL daemon with:
cd . ; /usr/local/mysql//bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd mysql-test ; perl mysql-test-run.pl

Please report any problems with the ./bin/mysqlbug script!

The latest information about MySQL is available on the web at
[url]http://www.mysql.com[/url]
Support MySQL by buying support/licenses at [url]http://shop.mysql.com[/url]
正常启动

[root@localhost mysql]# /usr/local/mysql/bin/mysqld_safe &
[1] 2680
[root@localhost mysql]# 071129 13:45:16 mysqld_safe Logging to '/usr/local/mysql/data//localhost.localdomain.err'.
/usr/local/mysql/bin/mysqld_safe: line 366: [: -eq: unary operator expected
071129 13:45:16 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data/
ps aux | grep mysql
root      2680  0.0  0.1   4684  1144 pts/0    S    13:45   0:00 /bin/sh /usr/local/mysql/bin/mysqld_safe
nobody    2748  1.6  1.7 108948 16796 pts/0    Sl   13:45   0:00 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data/ --user=nobody --log-error=/usr/local/mysql/data//localhost.localdomain.err --pid-file=/usr/local/mysql/data//localhost.localdomain.pid --socket=/tmp/mysql.sock --port=3306
root      2762  0.0  0.0   4120   668 pts/0    S+   13:45   0:00 grep mysql

2、用 mysqldumpshow时遇到的错误:
[root@localhost bin]# mysqldumpslow 
Can't determine basedir from 'my_print_defaults mysqld' output: --max-allowed-packet=100M
export PATH=$PATH:/usr/local/mysql/bin

就可以解决。







本文转自 david_yeung 51CTO博客,原文链接:http://blog.51cto.com/yueliangdao0608/81258,如需转载请自行联系原作者

相关实践学习
基于CentOS快速搭建LAMP环境
本教程介绍如何搭建LAMP环境,其中LAMP分别代表Linux、Apache、MySQL和PHP。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助     相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
相关文章
|
关系型数据库 MySQL Java
MySQL 巨坑:update 更新慎用影响行数做判断!!!
MySQL 巨坑:update 更新慎用影响行数做判断!!!
755 0
MySQL 巨坑:update 更新慎用影响行数做判断!!!
|
存储 关系型数据库 MySQL
MySQL出现Data too long for column...(错误号1406)和 Data truncated for column...(错误号1265)
MySQL出现Data too long for column...(错误号1406)和 Data truncated for column...(错误号1265)
582 0
MySQL出现Data too long for column...(错误号1406)和 Data truncated for column...(错误号1265)
|
数据可视化 关系型数据库 MySQL
mysql:解压版MySQL通过SQLyog可视化密码过期问题(错误号码1862)
mysql:解压版MySQL通过SQLyog可视化密码过期问题(错误号码1862)
348 0
mysql:解压版MySQL通过SQLyog可视化密码过期问题(错误号码1862)
|
SQL 存储 关系型数据库
MYSQL 索引成本计算,为什么MYSQL预判后选择了错误索引?
IO 成本: 即从磁盘把数据加载到内存的成本,默认情况下,读取数据页的 IO 成本是 1,MySQL 是以页的形式读取数据的,即当用到某个数据时,并不会只读取这个数据,而会把这个数据相邻的数据也一起读到内存中,这就是有名的程序局部性原理,所以 MySQL 每次会读取一整页,一页的成本就是 1。所以 IO 的成本主要和页的大小有关
219 0
|
关系型数据库 MySQL
mysql启动提示unrecognized service错误
mysql启动提示unrecognized service错误
591 0
|
关系型数据库 MySQL 数据库
MySQL无法启动的问题->MySQL 服务正在启动 . MySQL 服务无法启动。服务没有报告任何错误。 请键入 NET HELPMSG 3534 以获得更多的帮助
注意以上的操作会清除数据库内容及已经创建的数据库用户,会生成一个新的用户root,此用户没有密码🐱‍🏍
282 0
MySQL无法启动的问题->MySQL 服务正在启动 . MySQL 服务无法启动。服务没有报告任何错误。 请键入 NET HELPMSG 3534 以获得更多的帮助
|
关系型数据库 MySQL
MySQL基础-删除/更新行为
添加了外键之后,再删除父表数据时产生的约束行为,我们就称为删除/更新行为。具体的删除/更新行为有以下几种:
156 0
|
关系型数据库 MySQL 索引
mysql更新varchar类型字段长度报错:ERROR 1074 (42000): Column length too big for column ‘value‘ (max = 21845);
mysql更新varchar类型字段长度报错:ERROR 1074 (42000): Column length too big for column ‘value‘ (max = 21845);
|
关系型数据库 MySQL 网络安全
【C#】【MySQL】【配置数据源】SSL Connection error 发生一个或多个错误。由于·意外的数据包格式,握手失败
【C#】【MySQL】【配置数据源】SSL Connection error 发生一个或多个错误。由于·意外的数据包格式,握手失败
144 0
【C#】【MySQL】【配置数据源】SSL Connection error 发生一个或多个错误。由于·意外的数据包格式,握手失败
|
关系型数据库 MySQL C++
安装MySQL时报由于找不到VCRUNTIME140_1.dll,无法继续执行代码。重新安装程序可能会解决此问题错误
安装MySQL时报由于找不到VCRUNTIME140_1.dll,无法继续执行代码。重新安装程序可能会解决此问题错误
安装MySQL时报由于找不到VCRUNTIME140_1.dll,无法继续执行代码。重新安装程序可能会解决此问题错误