LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   MYSQL does not load (https://www.linuxquestions.org/questions/linux-software-2/mysql-does-not-load-443376/)

booga 05-10-2006 04:37 AM

MYSQL does not load
 
I enter the command to run MYSQL, and it hangs

Code:

mysql# Starting mysqld daemon with databases from /usr/mysql/mysql/data
STOPPING server from pid file /usr/mysql/mysql/data/workx.pid
060510 01:10:49  mysqld ended

it hangs at the above line. CTRL C ends with the following lines.
Code:

[1]+  Done                    /usr/mysql/mysql/bin/mysqld_safe –user=mysql
It seems to be a problem with the data folder. I'm new to MYSQL (this is obvious from the way I have the folders structured), and i'm not sure about the user and group permissions of the folders. Is it normal to have it 8972:8972? If not normal, what should it be?

Code:

mysql# ls -al
total 55
drwxr-xr-x  14  8972 8972  512 2006-04-27 08:57 .
drwxr-xr-x  4  test root  216 2006-05-10 00:40 ..
-rw-r--r--  1  8972 8972 19071 2006-04-26 18:31 COPYING
-rw-r--r--  1  8972 8972  5712 2006-04-27 08:40 EXCEPTIONS-CLIENT
-rw-r--r--  1  8972 8972  7747 2006-04-27 08:40 INSTALL-BINARY
-rw-r--r--  1  8972 8972  1380 2006-04-26 18:30 README
drwxr-xr-x  2  8972 8972  1768 2006-04-27 08:57 bin
-rwxr-xr-x  1  8972 8972  801 2006-04-27 08:57 configure
drwxr-x---  4 mysql 8972  128 2006-05-10 00:44 data
drwxr-xr-x  2  8972 8972  112 2006-04-27 08:57 docs
drwxr-xr-x  2  8972 8972  1880 2006-04-27 08:57 include
drwxr-xr-x  2  8972 8972  304 2006-04-27 08:57 lib
drwxr-xr-x  3  8972 8972    72 2006-04-27 08:57 man
drwxr-xr-x  7  8972 8972  368 2006-04-27 08:57 mysql-test
drwxr-xr-x  2  8972 8972    80 2006-04-27 08:57 scripts
drwxr-xr-x  3  8972 8972  160 2006-04-27 08:57 share
drwxr-xr-x  5  8972 8972  944 2006-04-27 08:57 sql-bench
drwxr-xr-x  2  8972 8972  456 2006-04-27 08:57 support-files
drwxr-xr-x  2  8972 8972  680 2006-04-27 08:57 tests


reddazz 05-10-2006 09:34 PM

Did you change ownership of /usr/local/mysql/data to the mysql user before starting mysql for the first time e.g.
Code:

#chown mysql:mysql /user/local/mysql/data
The error log in /usr/local/mysql/data will give you more clues.

booga 05-10-2006 11:44 PM

Thank you!

I now get a password prompt, which is a good sign. I don't remember seeing the instruction to chown the DATA folder in any of the manuals I tried to follow.

However I get an error message after I enter all possible passwords that it could be.

The error:
Code:

$ mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)

I'm sure that this is simple, but at this point of trying to resolve it, my eyes feel like my brain is trying to kick it out of the sockets. :-)

Thank you again for your help!

.

reddazz 05-11-2006 03:50 AM

Have you looked at the error logs in /usr/local/mysql/data ? Also what were the commands you use to compile it.

booga 05-11-2006 01:24 PM

this is all the contents of the file in /usr/local/mysql/data/workx.err
This includes some logged errors from other attempts.
From the last half, it appears to be running, I'm not sure what the log is telling me.

Linux is fairly new to me, MYSQL is beyond that. :-)


Code:

060509 04:39:05  mysqld started
060509  4:39:05  InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: 'create'.
InnoDB: Cannot continue operation.
060509 04:39:05  mysqld ended

060510 00:47:45  mysqld started
/usr/mysql/mysql/bin/mysqld: Too many arguments (first extra is '.user=mysql').
Use --help to get a list of available options
060510 00:47:45  mysqld ended

060510 00:50:50  mysqld started
/usr/mysql/mysql/bin/mysqld: Too many arguments (first extra is '.user=mysql').
Use --help to get a list of available options
060510 00:50:50  mysqld ended

060510 00:54:11  mysqld started
/usr/mysql/mysql/bin/mysqld: Too many arguments (first extra is '.user=mysql').
Use --help to get a list of available options
060510 00:54:11  mysqld ended

060510 00:54:24  mysqld started
/usr/mysql/mysql/bin/mysqld: Too many arguments (first extra is '.user=mysql').
Use --help to get a list of available options
060510 00:54:24  mysqld ended

060510 01:10:22  mysqld started
/usr/mysql/mysql/bin/mysqld: Too many arguments (first extra is '.user=mysql').
Use --help to get a list of available options
060510 01:10:22  mysqld ended

060510 01:10:49  mysqld started
/usr/mysql/mysql/bin/mysqld: Too many arguments (first extra is '.user=mysql').
Use --help to get a list of available options
060510 01:10:49  mysqld ended

060510 13:18:53  mysqld started
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
060510 13:18:54  InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
060510 13:18:58  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...
060510 13:19:00  InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 5 MBStatus information:

Current dir: /usr/mysql/mysql/data/
Running threads: 0  Stack size: 196608
Current locks:
lock: 0x8a7b774:

lock: 0x8a763dc:

lock: 0x8a71be4:

lock: 0x8a6487c:

lock: 0x8a61914:

lock: 0x8a5cb9c:


Key caches:
default
Buffer_size:      8388600
Block_size:          1024
Division_limit:        100
Age_limit:            300
blocks used:            0
not flushed:            0
w_requests:              0
writes:                  0
r_requests:              0
reads:                  0


handler status:
read_key:            0
read_next:          0
read_rnd            0
read_first:          3
write:              0
delete              0
update:              0

Table status:
Opened tables:        12
Open tables:            6
Open files:            12
Open streams:          0

Alarm status:
Active alarms:  0
Max used alarms: 0
Next alarm time: 0
A mysqld process already exists at  Wed May 10 20:21:42 UTC 2006
A mysqld process already exists at  Wed May 10 20:22:35 UTC 2006
A mysqld process already exists at  Thu May 11 10:13:01 UTC 2006

As I am digging around, I find a post suggestingto make sure that MYSQLD is started.

Code:

$ /usr/local/mysql/bin/mysqld     
060511 14:43:46 [Warning] Can't create test file /usr/local/mysql-standard-5.0.21-linux-i686-glibc23/data/workx.lower-test
/usr/local/mysql/bin/mysqld: Can't change dir to '/usr/local/mysql-standard-5.0.21-linux-i686-glibc23/data/' (Errcode: 13)
060511 14:43:46 [ERROR] Aborting

060511 14:43:46 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete

It appears to be some kind of issue with permissions. But I'm not sure what file or folder. And what permissions to set.

I checked the following folder for permissions
/var/lib/mysql drwxr-x--- 4 mysql mysql 248 2006-05-10 01:44

reddazz 05-12-2006 01:44 AM

change the premissons for you mysql data directory so that its owned by the mysql user and mysql group e.g.
Code:

#chown -R mysql:mysql /usr/local/mysql/data

chrism01 05-12-2006 02:32 AM

Incidentally, if you get numerics where you expect a user or group name in and ls -l listing, this means there is no entry for that user ( or group) in the /etc/passwd (/etc/group) files.
IOW, under the hood, everything is done with numbers (like DNS/bind). It only shows names where it can find a match in the relevant file.


All times are GMT -5. The time now is 02:38 PM.