12
返回列表 发新帖
楼主: risepp

启动mysql报错

[复制链接]
论坛徽章:
52
2015年新春福章
日期:2015-03-06 11:57:312012新春纪念徽章
日期:2012-02-13 15:12:252012新春纪念徽章
日期:2012-02-13 15:12:25生肖徽章2007版:龙
日期:2012-02-07 10:33:22生肖徽章2007版:龙
日期:2012-02-07 10:33:22生肖徽章2007版:龙
日期:2012-02-07 10:33:22生肖徽章2007版:龙
日期:2012-02-07 10:33:22生肖徽章2007版:龙
日期:2012-02-07 10:33:22生肖徽章2007版:龙
日期:2012-02-07 10:32:552012新春纪念徽章
日期:2012-02-07 09:59:35
11#
发表于 2008-5-9 13:59 | 只看该作者
估计你是 安装完了mysql后,没有 执行 mysql_install_db 脚本吧

这个脚本 生成系统 数据库 mysql 与测试 数据库  test

你 检查下你的 mysql数据vku是否 存在 。。就是 数据目录(默认..../mysql/var)
若存在则检查下 权限

使用道具 举报

回复
论坛徽章:
7
会员2006贡献徽章
日期:2006-04-17 13:46:34会员2007贡献徽章
日期:2007-09-26 18:42:10ITPUB新首页上线纪念徽章
日期:2007-10-20 08:38:442010新春纪念徽章
日期:2010-03-01 11:06:132011新春纪念徽章
日期:2011-01-04 10:37:342011新春纪念徽章
日期:2011-02-18 11:43:342012新春纪念徽章
日期:2012-01-04 11:50:44
12#
 楼主| 发表于 2008-5-9 20:22 | 只看该作者
果然没有,晕,这个应该怎么修复呢? 我在网上查了,把缺失的表补上就行了,但是现在连mysql都无法登陆,我试试运行mysql_install_db 。 谢谢!

使用道具 举报

回复
论坛徽章:
7
会员2006贡献徽章
日期:2006-04-17 13:46:34会员2007贡献徽章
日期:2007-09-26 18:42:10ITPUB新首页上线纪念徽章
日期:2007-10-20 08:38:442010新春纪念徽章
日期:2010-03-01 11:06:132011新春纪念徽章
日期:2011-01-04 10:37:342011新春纪念徽章
日期:2011-02-18 11:43:342012新春纪念徽章
日期:2012-01-04 11:50:44
13#
 楼主| 发表于 2008-5-9 22:24 | 只看该作者
我重新装了一下,没有pkgrm的情况下报错了。
## Installing part 1 of 1.
[ verifying class <none> ]
## Executing postinstall script.
ERROR: 1136  Column count doesn't match value count at row 1
080509 22:22:48 [ERROR] Aborting

080509 22:22:48 [Note] /opt/mysql/mysql/bin/mysqld: Shutdown complete


Installation of system tables failed!  Examine the logs in
/var/lib/mysql for more information.

You can try to start the mysqld daemon with:

    shell> /opt/mysql/mysql/bin/mysqld --skip-grant &

and use the command line tool /opt/mysql/mysql/bin/mysql
to connect to the mysql database and look at the grant tables:

    shell> /opt/mysql/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 /var/lib/mysql that may be helpful.

The latest information about MySQL is available on the web at
http://www.mysql.com/.  Please consult the MySQL manual section
'Problems running mysql_install_db', and the manual section that
describes problems on your OS.  Another information source are the
MySQL email archives available at http://lists.mysql.com/.

Please check all of the above before mailing us!  And remember, if
you do mail us, you MUST use the /opt/mysql/mysql/scripts/mysqlbug script!

ERROR: directory /usr/local/mysql found where need to install soft link
pkgadd: ERROR: postinstall script did not complete successfully

Installation of <mysql> failed.

使用道具 举报

回复
论坛徽章:
7
会员2006贡献徽章
日期:2006-04-17 13:46:34会员2007贡献徽章
日期:2007-09-26 18:42:10ITPUB新首页上线纪念徽章
日期:2007-10-20 08:38:442010新春纪念徽章
日期:2010-03-01 11:06:132011新春纪念徽章
日期:2011-01-04 10:37:342011新春纪念徽章
日期:2011-02-18 11:43:342012新春纪念徽章
日期:2012-01-04 11:50:44
14#
 楼主| 发表于 2008-5-9 22:53 | 只看该作者
我用pkgrm删除后还是报错

使用道具 举报

回复
论坛徽章:
7
会员2006贡献徽章
日期:2006-04-17 13:46:34会员2007贡献徽章
日期:2007-09-26 18:42:10ITPUB新首页上线纪念徽章
日期:2007-10-20 08:38:442010新春纪念徽章
日期:2010-03-01 11:06:132011新春纪念徽章
日期:2011-01-04 10:37:342011新春纪念徽章
日期:2011-02-18 11:43:342012新春纪念徽章
日期:2012-01-04 11:50:44
15#
 楼主| 发表于 2008-5-10 00:31 | 只看该作者
我现在将虚拟机的备份恢复了,然后重装就没有报错了! 但是还是出现之前mysql.sock文件不正确的错。
查日志还是报错说
080510 00:28:04 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
/usr/local/mysql/bin/mysqld: Table 'mysql.plugin' doesn't exist
080510  0:28:04 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
080510  0:28:05  InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
080510  0:28:05  InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
080510  0:28:05  InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
080510  0:28:06  InnoDB: Started; log sequence number 0 0
080510  0:28:06 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
080510 00:28:06 mysqld_safe mysqld from pid file /usr/local/mysql/data/Solaris.pid ended
~

我奇怪的是我安装完mysql之后,有三个目录都有和mysql相关的文件

-bash-3.00# pwd
/usr/local/mysql
-bash-3.00# ll
total 100
drwxr-xr-x  13 root     bin          512  5月 10 00:21 .
drwxr-xr-x   3 root     root         512  5月 10 00:21 ..
drwxr-xr-x   2 root     bin         1536  5月 10 00:21 bin
-rw-r--r--   1 root     bin        19071  2月 13 22:16 COPYING
drwxr-xr-x   4 mysql    mysql        512  5月 10 00:28 data
-rw-r--r--   1 root     bin         5139  2月 13 22:16 EXCEPTIONS-CLIENT
drwxr-xr-x   2 root     bin         1024  5月 10 00:21 include
drwxr-xr-x   2 root     bin          512  5月 10 00:21 info
-rw-r--r--   1 root     bin         8786  2月 13 22:16 INSTALL-BINARY
drwxr-xr-x   2 root     bin         1024  5月 10 00:21 lib
drwxr-xr-x   4 root     bin          512  5月 10 00:21 man
drwxr-xr-x  10 mysql    mysql        512  5月 10 00:21 mysql-test
-rw-r--r--   1 root     bin         1410  2月 13 22:16 README
drwxr-xr-x   2 root     bin          512  5月 10 00:21 scripts
drwxr-xr-x  27 root     bin         1024  5月 10 00:21 share
drwxr-xr-x   5 root     bin         1024  5月 10 00:21 sql-bench
drwxr-xr-x   2 root     bin          512  5月 10 00:21 support-files


-bash-3.00# pwd
/var/lib/mysql
-bash-3.00# ls
mysql  test
-bash-3.00# cd mysql
-bash-3.00# ls
columns_priv.frm               help_keyword.frm               proc.frm                       time_zone_leap_second.MYI
columns_priv.MYD               help_keyword.MYD               proc.MYD                       time_zone.MYD
columns_priv.MYI               help_keyword.MYI               proc.MYI                       time_zone.MYI
db.frm                         help_relation.frm              procs_priv.frm                 time_zone_name.frm
db.MYD                         help_relation.MYD              procs_priv.MYD                 time_zone_name.MYD
db.MYI                         help_relation.MYI              procs_priv.MYI                 time_zone_name.MYI
event.frm                      help_topic.frm                 servers.frm                    time_zone_transition.frm
event.MYD                      help_topic.MYD                 servers.MYD                    time_zone_transition.MYD
event.MYI                      help_topic.MYI                 servers.MYI                    time_zone_transition.MYI
func.frm                       host.frm                       slow_log.CSM                   time_zone_transition_type.frm
func.MYD                       host.MYD                       slow_log.CSV                   time_zone_transition_type.MYD
func.MYI                       host.MYI                       slow_log.frm                   time_zone_transition_type.MYI
general_log.CSM                ndb_binlog_index.frm           tables_priv.frm                user.frm
general_log.CSV                ndb_binlog_index.MYD           tables_priv.MYD                user.MYD
general_log.frm                ndb_binlog_index.MYI           tables_priv.MYI                user.MYI
help_category.frm              plugin.frm                     time_zone.frm
help_category.MYD              plugin.MYD                     time_zone_leap_second.frm
help_category.MYI              plugin.MYI                     time_zone_leap_second.MYD


-bash-3.00# cd /opt/mysql/mysql/
-bash-3.00# ls
bin                EXCEPTIONS-CLIENT  INSTALL-BINARY     mysql-test         share
COPYING            include            lib                README             sql-bench
data               info               man                scripts            support-files
-bash-3.00# pwd
/opt/mysql/mysql

我用pkgadd安装的时候提示的路径是在/opt/mysql下的

使用道具 举报

回复
论坛徽章:
7
会员2006贡献徽章
日期:2006-04-17 13:46:34会员2007贡献徽章
日期:2007-09-26 18:42:10ITPUB新首页上线纪念徽章
日期:2007-10-20 08:38:442010新春纪念徽章
日期:2010-03-01 11:06:132011新春纪念徽章
日期:2011-01-04 10:37:342011新春纪念徽章
日期:2011-02-18 11:43:342012新春纪念徽章
日期:2012-01-04 11:50:44
16#
 楼主| 发表于 2008-5-10 00:45 | 只看该作者
请版主帮忙看看是不是这个原因,
因为我查了资料,mysql的参数文件路径如下:
❑ Global options: /etc/my.cnf
❑ Server-specific options: <data directory>/my.cnf
❑ User-specific options: ~/.my.cnf
我在这几个地方都找了,没找到该参数文件,我手动创建了一个,运行
-bash-3.00# /opt/mysql/mysql/bin/mysqld_safe --user=root &
[1] 1256
-bash-3.00# 080510 00:40:05 mysqld_safe Logging to '/var/lib/mysql/Solaris.err'.
080510 00:40:05 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql

-bash-3.00# ps -ef | grep mysql
    root  1256   658   0 00:40:05 pts/5       0:00 /bin/sh /opt/mysql/mysql/bin/mysqld_safe --user=root
    root  1345  1256   2 00:40:05 pts/5       0:01 /usr/local/mysql/bin/mysqld --basedir=/opt/mysql/mysql --datadir=/var/lib/mysql
    root  1347   658   0 00:40:23 pts/5       0:00 grep mysql

似乎mysql进程已经启动了,但是我从远程连接该数据库还是不行。打算修改root密码试试,结果
-bash-3.00# /opt/mysql/mysql/bin/mysqladmin -u root password
ld.so.1: /opt/mysql/mysql/bin/mysqladmin: fatal: /lib/libnsl.so.1: mmap failed: Resource temporarily unavailable
ld.so.1: /opt/mysql/mysql/bin/mysqladmin: fatal: libnsl.so.1: open failed: No such file or directory

使用道具 举报

回复
论坛徽章:
7
会员2006贡献徽章
日期:2006-04-17 13:46:34会员2007贡献徽章
日期:2007-09-26 18:42:10ITPUB新首页上线纪念徽章
日期:2007-10-20 08:38:442010新春纪念徽章
日期:2010-03-01 11:06:132011新春纪念徽章
日期:2011-01-04 10:37:342011新春纪念徽章
日期:2011-02-18 11:43:342012新春纪念徽章
日期:2012-01-04 11:50:44
17#
 楼主| 发表于 2008-5-10 01:07 | 只看该作者
我用/opt/mysql/mysql/support-files下的mysql.server脚本把服务启动起来了,看来问题原因就是因为没有参数文件。
我倒,linux和windows下安装好了就都有了,solaris下必须自己创建啊?

还有就是我在数据库上做一些操作后,时不时会跳出错误提示
080510  1:01:48 [ERROR] ./mysqld: Out of memory (Needed 16392 bytes)
080510  1:01:51 [ERROR] ./mysqld: Out of memory (Needed 16392 bytes)
080510  1:01:51 [ERROR] ./mysqld: Out of memory (Needed 16392 bytes)
080510  1:01:54 [ERROR] ./mysqld: Out of memory (Needed 16392 bytes)
080510  1:01:54 [ERROR] ./mysqld: Out of memory (Needed 16392 bytes)

这个是不是我什么参数设置小了啊?

下面是我自己写的参数文件的内容:
[client]
port=3306
[mysql]
default-character-set=latin1
[mysqld]
port=3306
basedir="/opt/mysql/mysql"
datadir="/var/lib/mysql"
default-character-set=latin1
default-storage-engine=INNODB
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
max_connections=100
query_cache_size=0
table_cache=256
tmp_table_size=18M
thread_cache_size=8
myisam_max_sort_file_size=100G
myisam_max_extra_sort_file_size=100G
myisam_sort_buffer_size=35M
key_buffer_size=25M
read_buffer_size=64K
read_rnd_buffer_size=256K
sort_buffer_size=256K
innodb_additional_mem_pool_size=2M
innodb_flush_log_at_trx_commit=1
innodb_log_buffer_size=1M
innodb_buffer_pool_size=47M
innodb_log_file_size=24M
innodb_thread_concurrency=8

使用道具 举报

回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表