ITPUB??ì3

标题: 启动mysql报错
离线 jinguanding
Eugene


来自 上海
精华贴数 1
个人空间 70
技术积分 2350 (659)
社区积分 74 (3948)
注册日期 2007-3-29
论坛徽章:4
现任管理团队成员2008北京奥运纪念徽章:柔道生肖徽章2007版:鼠ITPUB新首页上线纪念徽章  
      

发表于 2008-5-9 13:59 
估计你是 安装完了mysql后,没有 执行 mysql_install_db 脚本吧

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

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


__________________
.....做人做事尽心尽力,做学问谦虚求根问底.......

.....专业的综合布线、安防公司........................
......www.showgold.cn..............................
......上海亮金信息技术有限公司.......................
只看该作者    顶部
离线 risepp
在迷惘中前行的人~~~~~


精华贴数 0
个人空间 0
技术积分 4020 (347)
社区积分 2 (25755)
注册日期 2004-12-10
论坛徽章:3
会员2007贡献徽章会员2006贡献徽章ITPUB新首页上线纪念徽章   
      

发表于 2008-5-9 20:22 
果然没有,晕,这个应该怎么修复呢? 我在网上查了,把缺失的表补上就行了,但是现在连mysql都无法登陆,我试试运行mysql_install_db 。 谢谢!


__________________
拨开迷雾 终将看到光明 相信自己 终能获得成功
只看该作者    顶部
离线 risepp
在迷惘中前行的人~~~~~


精华贴数 0
个人空间 0
技术积分 4020 (347)
社区积分 2 (25755)
注册日期 2004-12-10
论坛徽章:3
会员2007贡献徽章会员2006贡献徽章ITPUB新首页上线纪念徽章   
      

发表于 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.


__________________
拨开迷雾 终将看到光明 相信自己 终能获得成功
只看该作者    顶部
离线 risepp
在迷惘中前行的人~~~~~


精华贴数 0
个人空间 0
技术积分 4020 (347)
社区积分 2 (25755)
注册日期 2004-12-10
论坛徽章:3
会员2007贡献徽章会员2006贡献徽章ITPUB新首页上线纪念徽章   
      

发表于 2008-5-9 22:53 
我用pkgrm删除后还是报错


__________________
拨开迷雾 终将看到光明 相信自己 终能获得成功
只看该作者    顶部
离线 risepp
在迷惘中前行的人~~~~~


精华贴数 0
个人空间 0
技术积分 4020 (347)
社区积分 2 (25755)
注册日期 2004-12-10
论坛徽章:3
会员2007贡献徽章会员2006贡献徽章ITPUB新首页上线纪念徽章   
      

发表于 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下的


__________________
拨开迷雾 终将看到光明 相信自己 终能获得成功
只看该作者    顶部
离线 risepp
在迷惘中前行的人~~~~~


精华贴数 0
个人空间 0
技术积分 4020 (347)
社区积分 2 (25755)
注册日期 2004-12-10
论坛徽章:3
会员2007贡献徽章会员2006贡献徽章ITPUB新首页上线纪念徽章   
      

发表于 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


__________________
拨开迷雾 终将看到光明 相信自己 终能获得成功
只看该作者    顶部
离线 risepp
在迷惘中前行的人~~~~~


精华贴数 0
个人空间 0
技术积分 4020 (347)
社区积分 2 (25755)
注册日期 2004-12-10
论坛徽章:3
会员2007贡献徽章会员2006贡献徽章ITPUB新首页上线纪念徽章   
      

发表于 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


__________________
拨开迷雾 终将看到光明 相信自己 终能获得成功
只看该作者    顶部
相关内容


CopyRight 1999-2006 itpub.net All Right Reserved.
北京皓辰广域网络信息技术有限公司. 版权所有
E-mail:Webmaster@itpub.net
京ICP证:010037号 联系我们 法律顾问