Friday Jun 20, 2008

unable to start up MySQL after installing the MySQL package in Solaris

Sometime ago, after I installed the package-based MySQL Community Server 5.0.51a in my Solaris. I am unable to start it up,  e.g.


 su - mysql

bash-2.03$ ./bin/mysqld
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
080513 11:58:53  InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
080513 11:58:53  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...
080513 11:58:53  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
080513 11:58:53  InnoDB: Started; log sequence number 0 0
080513 11:58:54 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist


I looked up and searched inside MySQL bugs, and think I may hit bug http://bugs.mysql.com/bug.php?id=31058  


"The innodb log files are placed into /usr/local/mysql/data, so this is where mysqld expects to find the rest of the table files by default. Copying the contents of /var/lib/mysql/\* to /usr/local/mysql/data/\* and restarting mysqld resolves the problem, so the files are being created correctly, just in the wrong place.

Suggested fix:
Identification of the installation location during PKG builds is wrong and the files are being installed in the wrong place. This may relate to the directory installation issues that are also part of Bug #31057.
"



So, I copied all needed into my data directory below,


apple:/opt/mysql/mysql/data/mysql> cp /var/lib/mysql/mysql/\*  .



Then it can now start ok,



bash-2.03$ ./bin/mysqld
InnoDB: Log scan progressed past the checkpoint lsn 0 36808
080513 12:26:16  InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
InnoDB: Doing recovery: scanned up to log sequence number 0 43655
080513 12:26:17  InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percents: 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
InnoDB: Apply batch completed
080513 12:26:17  InnoDB: Started; log sequence number 0 43655
080513 12:26:17 [Note] ./bin/mysqld: ready for connections.
Version: '5.0.51a'  socket: '/tmp/mysql.sock'  port: 3306  MySQL Community



Hope this can help someone facing this issue in Solaris. 

Friday May 30, 2008

unable to install MySQL pkg file in Solaris with a small /var partition

I got a small Solaris 8 old machine with a small /var partition.


When I tried to install the MySQL pkg (package format), I got  "No space left on device " due to a filled up /var.

e.g.

shell:/export/home/bits/mysql> pkgadd -d mysql-5.0.51a-solaris8-sparc.pkg

The following packages are available:
  1  mysql     MySQL Community Server (GPL)
               (sun4u) 5.0.51a

Select package(s) you wish to process (or 'all' to process
all packages). (default: all) [?,??,q]:

Processing package instance <mysql> from </export/home/bits/mysql/mysql-5.0.51a-solaris8-sparc.pkg>

MySQL Community Server (GPL)
(sun4u) 5.0.51a

cpio: Cannot write "reloc/mysql/lib/libmystrings.a", errno 28, No space left on device
cpio: Cannot write "reloc/mysql/lib/libmysys.a", errno 28, No space left on device
cpio: Cannot write "reloc/mysql/lib/libz.a", errno 28, No space left on device
cpio: Cannot write "reloc/mysql/man/man1/myisamchk.1", errno 28, No space left on device
cpio: Cannot write "reloc/mysql/man/man1/myisampack.1", errno 28, No space left on device
cpio: Cannot write "reloc/mysql/man/man1/mysql-stress-test.pl.1", errno 28, No space left on device
cpio: Cannot write "reloc/mysql/man/man1/mysql-test-run.pl.1", errno 28, No space left on device
cpio: Cannot write "reloc/mysql/man/man1/mysql.1", errno 28, No space left on device
cpio: Cannot write "reloc/mysql/man/man1/mysql_tableinfo.1", errno 28, No space left on device
cpio: Cannot write "reloc/mysql/man/man1/mysqlaccess.1", errno 28, No space left on device
cpio: Cannot write "reloc/mysql/man/man1/mysqladmin.1", errno 28, No space left on device
.........
pkgadd: ERROR: attempt to process datastream failed
    - process </usr/bin/cpio -icdumD -C 512> failed, exit code 107
pkgadd: ERROR: unable to unpack datastream

Installation of <mysql> failed (internal error).
No changes were made to the system.

Then I checked the df ,

shell:/export/home/bits/mysql> df -k
Filesystem            kbytes    used   avail capacity  Mounted on
/dev/dsk/c1t1d0s0    5046030  492972 4502598    10%    /
/dev/dsk/c1t1d0s3    5046030 2459989 2535581    50%    /usr
/proc                      0       0       0     0%    /proc
fd                         0       0       0     0%    /dev/fd
mnttab                     0       0       0     0%    /etc/mnttab
/dev/dsk/c1t1d0s4     498039  347600  100636    78%    /var
swap                 3132008      24 3131984     1%    /var/run
swap                 3148128   16144 3131984     1%    /tmp
/dev/dsk/c1t1d0s5    5046030 2990222 2005348    60%    /opt
/dev/dsk/c1t1d0s7    52857951 39795138 12534234    77%    /export/home
/dev/dsk/c1t2d0s7    35009161 26781384 7877686    78%    /export/home0

I watched df again during install , and found a full /var,

/dev/dsk/c1t1d0s4     498039  469731       0   100%    /var

so the above error.

To workaround this , I use the TMPDIR to let pkgadd to use another partition with enough space,
e.g.

shell:/export/home/bits/mysql> mkdir tmp
shell:/export/home/bits/mysql> export TMPDIR=/export/home/bits/mysql/tmp   \*\*\*

then pkgadd again,

shell:/export/home/bits/mysql> pkgadd  -d mysql-5.0.51a-solaris8-sparc.pkg

The following packages are available:
  1  mysql     MySQL Community Server (GPL)
               (sun4u) 5.0.51a

Select package(s) you wish to process (or 'all' to process
all packages). (default: all) [?,??,q]:

Processing package instance <mysql> from </export/home/bits/mysql/mysql-5.0.51a-solaris8-sparc.pkg>

MySQL Community Server (GPL)
(sun4u) 5.0.51a

........
/usr/bin/mysql <symbolic link>
/usr/bin/mysql-config <symbolic link>
/usr/bin/mysql_config <symbolic link>
....
/usr/sbin/safe_mysqld <symbolic link>
[ verifying class <none> ]
## Executing postinstall script.
scripts/mysql_install_db: !: not found
scripts/mysql_install_db: !: not found
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/opt/mysql/mysql/bin/mysqladmin -u root password 'new-password'
/opt/mysql/mysql/bin/mysqladmin -u root -h <host> password 'new-password'

Alternatively you can run:
/opt/mysql/mysql/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

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

The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com

Installation of <mysql> was successful.

So, this can be used as a workaround to install MySQL package format when /var is too small.
The same workaround (by setting TMPDIR to somewhere large enough) can be used for other pkgadd install when /var is not large enough.

About

Wing-Yip Walter Lee

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today