|
FreeBSD Ports and Packages Installation and upgrading of ports and packages on FreeBSD. |
|
Thread Tools | Display Modes |
|
|
|||
MySQL problems in FBSD 6.2
I tried to install MySQL 5.1 today on my FreeBSD 6.2 box. I'm not sure exactly how to start the troubleshooting.
First thing I noticed is I don't have a 'mysqld' executable. I did a rehash, and I still don't find it. Does it reside someplace odd? I do have /usr/local/bin/mysqld_safe and /usr/local/bin/mysqld_multi I tried starting 'mysqld_safe', and the following resulted: Code:
# /usr/local/bin/mysqld_safe 081207 19:54:00 mysqld_safe Logging to '/var/db/mysql/hostname.err'. 081207 19:54:00 mysqld_safe Starting mysqld daemon with databases from /var/db/mysql 081207 19:54:00 mysqld_safe mysqld from pid file /var/db/mysql/hostname.pid ended Code:
# mysqladmin ping mysqladmin: connect to server at 'localhost' failed error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)' Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists! Last edited by Mantazz; 9th April 2009 at 09:58 PM. Reason: clearing out un-needed, identifying information |
|
||||
You have to add the *_enable lines to /etc/rc.conf, and then use /usr/local/etc/rc.d/mysql-server start to fire it up. See the comments in the rc.d/ file for the variables you need to set in rc.conf.
This is documented in the rc(8), ports(7), and rc.conf(5) man pages, as well as the ports chapters in the Handbook. Note: for the best performance on FreeBSD, use the 5.0.x series of MySQL. |
|
|||
Still confused...
So I checked /usr/local/etc/rc.d/mysql-server and it said to add the following:
Code:
# Add the following line to /etc/rc.conf to enable mysql: # mysql_enable (bool): Set to "NO" by default. # Set it to "YES" to enable MySQL. # mysql_limits (bool): Set to "NO" by default. # Set it to yes to run `limits -e -U mysql` # just before mysql starts. # mysql_dbdir (str): Default to "/var/db/mysql" # Base database directory. # mysql_args (str): Custom additional arguments to be passed # to mysqld_safe (default empty). Code:
mysql_enable="YES" mysql_limits="NO" mysql_dbdir="/var/db/mysql" mysql_args="" All I saw was "Starting mysql.", then nothing happened. I tried to query the server with "mysqladmin ping" and the response was Code:
mysqladmin: connect to server at 'localhost' failed error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)' Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists! |
|
|||
Quote:
I ran the mysql_install_db command, and it ran without incident. I then tried to start mysql and it did nothing in particular. "mysqladmin ping" still returns the error Code:
mysqladmin: connect to server at 'localhost' failed error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (38)' Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists! Would it be at all useful to try uninstalling and reinstalling through ports, or do I have to muck through this by hand? It seems like there could be multiple missing things that are important to mysql, as the following lines from the /var/db/mysql log file indicate: Code:
081209 12:09:03 [ERROR] /usr/local/libexec/mysqld: Can't find file: './mysql/host.frm' (errno: 13) 081209 12:09:03 [ERROR] Fatal error: Can't open and lock privilege tables: Can't find file: './mysql/host.frm' (errno: 13) 081209 12:08:33 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it. 081209 12:04:22 [ERROR] Can't start server : Bind on unix socket: Address already in use 081209 12:04:22 [ERROR] Do you already have another mysqld server running on socket: /tmp/mysql.sock ? |
|
|||
Please help
Quote:
Mine is the same problem except mine's not fresh install. "mysqladmin ping" shows the same message as mantazz i.e. Quote:
|
|
||||
Quote:
# mysql_install_db --user=mysql Otherwise the ownership for the MySQL database are set to root:wheel, and since mysqld_safe is run as the mysql user ... If you've already run mysql_install_db, then just remove the /var/db/mysql directory and re-run the command with the --user argument (Assuming, ofcourse, there is nothing of value in /var/db/mysql).
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things. |
|
|||
Found it
The problem was the permissions on one directory. The directory /var/db/mysql/mysql
Was owned by root, with permissions set to 700. Changing ownership to mysql corrected this problem and now mysql starts correctly and responds to ping. Now I can start beating my head against the wall over SQL syntax instead ... thanks |
|
||||
SQL Syntax is trivial, and MySQL has an excellent reference manual.
__________________
My Journal Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Flash in FBSD 7.2 | Mantazz | FreeBSD Ports and Packages | 8 | 5th October 2009 05:37 AM |
dvb-t on FBSD? | michaelrmgreen | FreeBSD General | 3 | 15th May 2009 10:43 AM |
problems installing mysql port | dejabu18 | FreeBSD Ports and Packages | 22 | 7th August 2008 09:23 AM |
Eta Fbsd 7.1? | michaelrmgreen | FreeBSD General | 7 | 7th June 2008 05:56 AM |
mySql problems | dctr | FreeBSD Ports and Packages | 3 | 25th May 2008 05:52 PM |