# Problem starting MySQL server.



## Dex (Jul 30, 2011)

Hello. I've installed mysql51-server via portmaster and even after many reinstalls/configuration from reading Google results, mysqld seems to make everything hang when accessing it. I've also tried using the binaries.


```
install  -o root -g wheel -m 555 'mysql.server' '/usr/local/share/mysql/mysql.server'
 install  -o root -g wheel -m 555 'mysqld_multi.server' '/usr/local/share/mysql/mysqld_multi.server'
make abi_headers="" do_abi_check
set -ex;  for file in ; do  gcc47 -E -nostdinc -dI -DMYSQL_ABI_CHECK  -I./include  -I./include/mysql  -I./sql  -I./include  -I./include/mysql 
 -I./sql  $file 2>/dev/null |  /usr/bin/sed -e '/^# /d'  -e '/^[      ]*$/d'  -e '/^#pragma GCC set_debug_pwd/d'  -e '/^#ident/d' > 
 ./abi_check.out;  /usr/bin/diff -w $file.pp ./abi_check.out;  /bin/rm ./abi_check.out;  done
===> Installing rc.d startup script(s)
************************************************************************

Remember to run mysql_upgrade (with the optional --datadir=<dbdir> flag)
the first time you start the MySQL server after an upgrade from an
earlier version.

************************************************************************
install-info --quiet /usr/local/info/mysql.info /usr/local/info/dir
===> Correct pkg-plist sequence to create group(s) and user(s)
===>   Compressing manual pages for mysql-server-5.1.58
===>   Registering installation for mysql-server-5.1.58
DEX# /usr/local/etc/rc.d/mysql-server start
Starting mysql.
DEX#
DEX# exit
exit
$ su
Password:
DEX# mysql_upgrade
Looking for 'mysql' as: mysql
Looking for 'mysqlcheck' as: mysqlcheck
```

Then it just pauses. The same thing happens with phpmyadmin and just "mysql." Help would be appreciated.


----------



## Nightweaver (Jul 31, 2011)

Have you installed initial databases after installing MySQL? Do: 


```
/usr/local/bin/mysql_install_db 
chown mysql:mysql /var/db/mysql 
/usr/local/etc/rc.d/mysql-server start
```


----------



## Dex (Jul 31, 2011)

```
/usr/local/bin/mysql_install_db
Installing MySQL system tables...
110731  6:13:58 [Warning] /usr/local/libexec/mysqld: Option '--set-variable' is deprecated. Use --variable-name=value instead.
110731  6:13:58 [Warning] '--default-character-set' is deprecated and will be removed in a future release. Please use '--character-set-server' instead.
110731  6:13:58 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.
```

Then it hangs. I did the chown and tried to start the server though. (mysql-server starts, but mysql hangs)


----------



## Dex (Aug 1, 2011)

I don't know whether my FreeBSD install is broken or what. 


```
/usr/local/bin/mysql_install_db
Killed

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

You can try to start the mysqld daemon with:

    shell> /usr/local/libexec/mysqld --skip-grant &

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

    shell> /usr/local/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/db/mysql that may be helpful.

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 [url]http://lists.mysql.com/[/url].

Please check all of the above before mailing us!  And remember, if
you do mail us, you MUST use the /usr/local/bin/mysqlbug script!

0.055u 0.177s 12:39:45.98 0.0%  6126+5370k 0+22io 0pf+0w
```


----------



## Dex (Aug 1, 2011)

More info. I'm not sure what this means.


```
$ /usr/local/libexec/mysqld --skip-grant --skip-innodb
110731 19:14:55 [Warning] /usr/local/libexec/mysqld: Option '--set-variable' is deprecated. Use --variable-name=value instead.
110731 19:14:55 [Warning] '--default-character-set' is deprecated and will be removed in a future release. Please use '--character-set-server' instead.
110731 19:14:55 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.
110731 19:14:55 [Note] Plugin 'FEDERATED' is disabled.
110731 19:14:55 [Note] Plugin 'InnoDB' is disabled.

$ mysql
```
(hanging)


----------



## SirDice (Aug 1, 2011)

It looks like you built MySQL with GCC47. What's in /etc/make.conf?


----------



## Dex (Aug 1, 2011)

I didn't even think of gcc possibly being an issue.


```
cat /etc/make.conf
CFLAGS="-mssse3"
CXXFLAGS="-mssse3"
CC=gcc47
CXX=g++47
CPP=cpp47
PERL_VERSION=5.10.1
```


----------



## SirDice (Aug 1, 2011)

Remove everything except the PERL_VERSION line and rebuild MySQL.


----------



## Dex (Aug 2, 2011)

```
install  -o root -g wheel -m 444 'mysql-log-rotate' '/usr/local/share/mysql/mysql-log-rotate'
 install  -o root -g wheel -m 444 'binary-configure' '/usr/local/share/mysql/binary-configure'
 install  -o root -g wheel -m 444 'ndb-config-2-node.ini' '/usr/local/share/mysql/ndb-config-2-node.ini'
test -z "/usr/local/share/mysql" || .././install-sh -c -d "/usr/local/share/mysql"
 install  -o root -g wheel -m 555 'mysql.server' '/usr/local/share/mysql/mysql.server'
 install  -o root -g wheel -m 555 'mysqld_multi.server' '/usr/local/share/mysql/mysqld_multi.server'
===> Installing rc.d startup script(s)
************************************************************************

Remember to run mysql_upgrade (with the optional --datadir=<dbdir> flag)
the first time you start the MySQL server after an upgrade from an
earlier version.

************************************************************************
install-info --quiet /usr/local/info/mysql.info /usr/local/info/dir
===> Correct pkg-plist sequence to create group(s) and user(s)
===>   Compressing manual pages for mysql-server-5.0.92
===>   Registering installation for mysql-server-5.0.92
===> SECURITY REPORT:
      This port has installed the following files which may act as network
      servers and may therefore pose a remote security risk to the system.
/usr/local/libexec/mysqld

      This port has installed the following startup scripts which may cause
      these network services to be started at boot time.
/usr/local/etc/rc.d/mysql-server

      If there are vulnerabilities in these programs there may be a security
      risk to the system. FreeBSD makes no guarantee about the security of
      ports included in the Ports Collection. Please type 'make deinstall'
      to deinstall the port if this is a concern.

      For more information, and contact details about the security
      status of this software, see the following webpage:
http://www.mysql.com/
DEX# /usr/local/etc/rc.d/mysql-server start
Starting mysql.
DEX# /usr/local/etc/rc.d/mysql-server start
Starting mysql.
DEX# /usr/local/etc/rc.d/mysql-server start
Starting mysql.
DEX# exit
exit
[1]   Killed                  mysql
$ /usr/local/libexec/mysqld &
InnoDB: No valid checkpoint found.
InnoDB: If this error appears when you are creating an InnoDB database,
InnoDB: the problem may be that during an earlier attempt you managed
InnoDB: to create the InnoDB data files, but log file creation failed.
InnoDB: If that is the case, please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.0/en/error-creating-innodb.html
$ mysql
```

(hanging)

I'll try a default my.cnf now.


----------



## Dex (Aug 3, 2011)

I tried without my.cnf and then with a default, no go. I'm going to give up now, thanks for the advice anyway.


----------

