1428a [Solved] mysql will not start without localhost? - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Server & Networking > Web & Network Services

Web & Network Services Discussion related to network/web services such as apache, bind, sendmail, etc.

Reply
 
Thread Tools Display Modes
  #1  
Old April 11th, 2011, 18:55
reppa reppa is offline
Junior Member
 
Join Date: Aug 2010
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default mysql will not start without localhost?

Hi,

I have some problem with starting mysql (5.5.10) on FreeBSD 8.1.

When I try to start:

/usr/local/etc/rc.d/mysql-server start
Code:
Starting mysql.
/usr/local/etc/rc.d/mysql-server status
Code:
mysql is not running.
If I try this:
/usr/local/bin/mysqld_safe &
Code:
110411 19:45:20 mysqld_safe Logging to '/home/db/hostname.err'.  grep: grep: grep"74174: No such file or directory: No such file or 
directory
grep: ": No such file or directory
110411 19:45:20 mysqld_safe Starting mysqld daemon with databases from /home/db
Code:
# ps -auwx | grep mysql
root  73915  0.0  0.5  3628  1180   1  I     7:36PM   0:00.04 /bin/sh /usr/local/bin/mysqld_safe
mysql 74174  0.0 32.1 605508 79904   1  I     7:36PM   0:00.60 [mysqld]
So it seems to run on my server, but:
Code:
mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
If I try to connect with localhost information:
Code:
mysql -h 127.0.0.1 -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
...
What's wrong? It's seems to work, but not 100 %.

reppa

Last edited by DutchDaemon; April 11th, 2011 at 19:44. Reason: Proper formatting: http://forums.freebsd.org/showthread.php?t=8816
Reply With Quote
  #2  
Old April 11th, 2011, 20:23
SirDice's Avatar
SirDice SirDice is offline
Moderator
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 13,694
Thanks: 47
Thanked 2,020 Times in 1,859 Posts
Default

I'm assuming nothing is running in a jail?

But can you post the relevant rc.conf variables and/or your my.cnf?
__________________
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
Reply With Quote
  #3  
Old April 11th, 2011, 21:08
reppa reppa is offline
Junior Member
 
Join Date: Aug 2010
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Here is relevant information from my rc.conf:
Code:
mysql_enable="YES"
my.cnf
Code:
[client]
#password       = your_password
port            = 3306
socket          = /home/db/mysql.sock

# The MySQL server
[mysqld]
port            = 3306
socket          = /home/db/mysql.sock
datadir         = /home/db/
skip-external-locking
key_buffer_size = 384M
max_allowed_packet = 1M
table_open_cache = 512
sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size = 32M
thread_concurrency = 8
#skip-networking
log-bin=mysql-bin
server-id       = 1
#server-id       = 2
#master-host     =   <hostname>
#master-user     =   <username>
#master-password =   <password>
#master-port     =  <port>
#log-bin=mysql-bin
#binlog_format=mixed
#innodb_data_home_dir = /var/db/mysql
#innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend
#innodb_log_group_home_dir = /var/db/mysql
#innodb_buffer_pool_size = 384M
#innodb_additional_mem_pool_size = 20M
#innodb_log_file_size = 100M
#innodb_log_buffer_size = 8M
#innodb_flush_log_at_trx_commit = 1
#innodb_lock_wait_timeout = 50

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash
#safe-updates

[myisamchk]
key_buffer_size = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout

[mysql.server]
user=mysql
basedir=/usr/local/bin
ls -l /home/
Code:
drwx------  5 mysql   mysql      512 Apr 11 19:45 db
I'm sitting in jail?

reppa
Reply With Quote
  #4  
Old April 12th, 2011, 00:49
codeWarrior codeWarrior is offline
Junior Member
 
Join Date: Dec 2010
Location: Coeur d'Alene, Idaho
Posts: 19
Thanks: 1
Thanked 4 Times in 2 Posts
Default

You have some misconceptions about mySQL.... this is not a FreeBSD issue... it has to do with your mysql permissions and access... you should read up on mySQL.
Reply With Quote
  #5  
Old April 12th, 2011, 08:51
mamalos mamalos is offline
Member
 
Join Date: Mar 2009
Location: Greece
Posts: 427
Thanks: 25
Thanked 43 Times in 42 Posts
Default

Have you run mysql_install_db on your system? Do the requested files exist (eg. /home/db/hostname.err)? Because if they don't, your system won't start. What do your logfiles suggest (which I highly doubt they exist, since /home/db/hostname.err is one of them)? If they exist, check your permissions on these files.
Reply With Quote
  #6  
Old April 12th, 2011, 18:32
reppa reppa is offline
Junior Member
 
Join Date: Aug 2010
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

Here is my /home/db/hostname.err:

Code:
110412 19:24:42 mysqld_safe Starting mysqld daemon with databases from /home/db
110412 19:24:42 [Warning] Ignoring user change to 'ser=mysql' because the user was set to 'my$
110412 19:24:42 InnoDB: The InnoDB memory heap is disabled
110412 19:24:42 InnoDB: Mutexes and rw_locks use GCC atomic builtins
110412 19:24:42 InnoDB: Compressed tables use zlib 1.2.3
110412 19:24:43 InnoDB: Initializing buffer pool, size = 128.0M
110412 19:24:43 InnoDB: Completed initialization of buffer pool
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
110412 19:24:43  InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
110412 19:24:43  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...
110412 19:24:43  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: 127 rollback segment(s) active.
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
110412 19:24:43  InnoDB: Waiting for the background threads to start
110412 19:24:44 InnoDB: 1.1.5 started; log sequence number 0
110412 19:24:44 [ERROR] Can't start server: Bind on TCP/IP port: Address already in use
110412 19:24:44 [ERROR] Do you already have another mysqld server running on port: 3306 ?
110412 19:24:44 [ERROR] Aborting
110412 19:24:44  InnoDB: Starting shutdown...
110412 19:24:44  InnoDB: Shutdown completed; log sequence number 1595675
110412 19:24:45 [Note] /usr/local/libexec/mysqld: Shutdown complete
110412 19:24:45 mysqld_safe mysqld from pid file /home/db/xxxx.xxxx.no.pid ended
Code:
-rw-------  1 mysql  mysql        70 Apr 12 19:17 .my.cnf.84316
-rw-------  1 mysql  mysql         1 Apr 12 19:17 .mysql.84316
-rw-rw----  1 mysql  mysql   5242880 Apr 12 19:24 ib_logfile0
-rw-rw----  1 mysql  mysql   5242880 Apr 12 19:24 ib_logfile1
-rw-rw----  1 mysql  mysql  18874368 Apr 12 19:24 ibdata1
-rw-rw----  1 mysql  mysql      1972 Apr 12 19:24 xxx.xxxx.no.err
drwx------  2 mysql  mysql      2048 Apr 12 19:16 mysql
-rw-rw----  1 mysql  mysql     29704 Apr 12 19:16 mysql-bin.000001
-rw-rw----  1 mysql  mysql    995332 Apr 12 19:16 mysql-bin.000002
-rw-rw----  1 mysql  mysql       126 Apr 12 19:24 mysql-bin.000003
-rw-rw----  1 mysql  mysql        57 Apr 12 19:24 mysql-bin.index
drwx------  2 mysql  mysql      1024 Apr 12 19:16 performance_schema
drwx------  2 mysql  mysql       512 Apr 12 19:16 test
I ran /usr/local/bin/mysql_install_db --basedir=/usr/local after I had deleted db-files from /home/db

reppa

Last edited by DutchDaemon; April 12th, 2011 at 23:39.
Reply With Quote
  #7  
Old April 12th, 2011, 18:56
reppa reppa is offline
Junior Member
 
Join Date: Aug 2010
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by codeWarrior View Post
You have some misconceptions about mySQL.... this is not a FreeBSD issue... it has to do with your mysql permissions and access... you should read up on mySQL.
Can you give me a hint if you know what the problem is?

reppa

Last edited by DutchDaemon; April 12th, 2011 at 23:40.
Reply With Quote
  #8  
Old April 12th, 2011, 19:54
mamalos mamalos is offline
Member
 
Join Date: Mar 2009
Location: Greece
Posts: 427
Thanks: 25
Thanked 43 Times in 42 Posts
Default

Once your files are installed successfully, you just use the relevant rc.d script to start mysqld. Before that, be sure you have killed all mysqld processes, because that is what the message of your logs tells you.
Reply With Quote
  #9  
Old April 14th, 2011, 19:51
reppa reppa is offline
Junior Member
 
Join Date: Aug 2010
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Right permission to /tmp solved my problem. Mod can set this thread to solved.
Reply With Quote
  #10  
Old April 15th, 2011, 11:22
SirDice's Avatar
SirDice SirDice is offline
Moderator
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 13,694
Thanks: 47
Thanked 2,020 Times in 1,859 Posts
Default

Quote:
Originally Posted by reppa View Post
Right permission to /tmp solved my problem.
The permissions should be 1777 for that filesystem. That means it already had enough permissions. What exactly did you change it to?
__________________
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
Reply With Quote
Reply

Tags
localhost, mysql

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Solved] MySQL does not start znaminyto Web & Network Services 10 November 29th, 2010 07:55
[Solved] MySQL doesn't start after /var/log is cleared mzelensky Web & Network Services 13 September 26th, 2010 19:11
[Solved] MySQL won't start at boot makimoto Installation and Maintenance of FreeBSD Ports or Packages 14 September 8th, 2010 11:56
DBMail tries to start before MySQL ph0enix Web & Network Services 2 October 7th, 2009 04:57
[Solved] MySql Server does not start Ishildur Installation and Maintenance of FreeBSD Ports or Packages 22 February 14th, 2009 17:28


All times are GMT +1. The time now is 13:51.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0