LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-28-2013, 09:30 PM   #1
M4trixSh4d0w
LQ Newbie
 
Registered: Mar 2013
Posts: 14

Rep: Reputation: Disabled
Debian MySQL Problem


Hi, I have been having some trouble installing MySQL on my debian system. I installed with
Code:
apt-get install mysql-server-5.1
but it doesn't install properly
Code:
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  tinyca
The following NEW packages will be installed:
  mysql-server-5.1
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/6,540 kB of archives.
After this operation, 14.4 MB of additional disk space will be used.
Preconfiguring packages ...
Selecting previously deselected package mysql-server-5.1.
(Reading database ... 99326 files and directories currently installed.)
Unpacking mysql-server-5.1 (from .../mysql-server-5.1_5.1.66-0+squeeze1_i386.deb) ...
Processing triggers for man-db ...
Setting up mysql-server-5.1 (5.1.66-0+squeeze1) ...
Stopping MySQL database server: mysqld.
Starting MySQL database server: mysqld . . . . . . . . . . . . . . failed!
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.1 (--configure):
 subprocess installed post-installation script returned error exit status 1
configured to not write apport reports
                                      Errors were encountered while processing:
 mysql-server-5.1
E: Sub-process /usr/bin/dpkg returned an error code (1)
and when I try to start it
Code:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
I accidentally edited some file permissions, and that could be part of the problem.

Last edited by M4trixSh4d0w; 05-28-2013 at 09:34 PM.
 
Old 05-28-2013, 10:35 PM   #2
fortran
Member
 
Registered: Nov 2011
Location: Cairo, Egypt
Distribution: CentOS, RHEL, Fedora
Posts: 300
Blog Entries: 2

Rep: Reputation: 51
Try to configure dpkg
Code:
sudo dpkg --configure -a
Now run
Code:
sudo apt-get install -f
if you are still getting same problem,run
Code:
 sudo gedit /var/lib/dpkg/status
(you can use vi or nano instead of gedit)

Locate the corrupt package, and remove the whole block of information about it and save the file.
 
Old 05-28-2013, 10:55 PM   #3
M4trixSh4d0w
LQ Newbie
 
Registered: Mar 2013
Posts: 14

Original Poster
Rep: Reputation: Disabled
dpkg --configure -a
Has error: ERROR: 1036 Table 'user' is read only
Code:
Setting up mysql-server-5.1 (5.1.66-0+squeeze1) ...
Stopping MySQL database server: mysqld.
130528 20:37:33 [Note] Plugin 'FEDERATED' is disabled.
130528 20:37:33  InnoDB: Initializing buffer pool, size = 8.0M
130528 20:37:33  InnoDB: Completed initialization of buffer pool
130528 20:37:33  InnoDB: Started; log sequence number 0 44233
ERROR: 1036  Table 'user' is read only
130528 20:37:33 [ERROR] Aborting

<Dialog asks for root password for databases />

130528 20:37:33  InnoDB: Starting shutdown...
130528 20:37:38  InnoDB: Shutdown completed; log sequence number 0 44233
130528 20:37:38 [Note] /usr/sbin/mysqld: Shutdown complete


<Dialog pops up>
Unable to set password for the MySQL "root" user                          │  
 │                                                                           │  
 │ An error occurred while setting the password for the MySQL                │  
 │ administrative user. This may have happened because the account already   │  
 │ has a password, or because of a communication problem with the MySQL      │  
 │ server.                                                                   │  
 │                                                                           │  
 │ You should check the account's password after the package installation.   │  
 │                                                                           │  
 │ Please read the /usr/share/doc/mysql-server-5.1/README.Debian file for    │  
 │ more information.
</dialog>

Starting MySQL database server: mysqld . . . . . . . . . . . . . . failed!
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.1 (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 mysql-server-5.1
apt-get install -f

Code:
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up mysql-server-5.1 (5.1.66-0+squeeze1) ...
Stopping MySQL database server: mysqld.
Starting MySQL database server: mysqld . . . . . . . . . . . . . . failed!
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.1 (--configure):
 subprocess installed post-installation script returned error exit status 1
configured to not write apport reports
                                      Errors were encountered while processing:
 mysql-server-5.1
E: Sub-process /usr/bin/dpkg returned an error code (1)

nano /var/lib/dpkg/status
I'm confused on what you want me to do exactly, remove this bit?

Code:
Package: mysql-server-5.1
Status: install ok half-configured
Priority: optional
Section: misc
Installed-Size: 14040
Maintainer: Debian MySQL Maintainers <pkg-mysql-maint@lists.alioth.debian.org>
Architecture: i386
Source: mysql-5.1
Version: 5.1.66-0+squeeze1
Replaces: libmysqlclient-dev (<= 5.1.41-1), mysql-server (<< 5.1.66-0+squeeze1), mysql-server-5.0
Provides: mysql-server, mysql-server-5.0, virtual-mysql-server
Depends: mysql-client-5.1 (>= 5.1.66-0+squeeze1), libdbi-perl, perl (>= 5.6), libc6 (>= 2.7), libgcc1 (>= 1:4.1.1), libmysqlclient16 (>= 5.1.21-1), libstdc++6 (>= 4.1.1), zlib1g$
Pre-Depends: mysql-common (>= 5.1.66-0+squeeze1), adduser (>= 3.40), debconf
Recommends: mailx, libhtml-template-perl
Suggests: tinyca
Conflicts: mysql-server (<< 5.1.66-0+squeeze1), mysql-server-4.1
Conffiles:
 /etc/logrotate.d/mysql-server 64e209fe34f73fbf10c9479bf30947c4
 /etc/mysql/debian-start 4272e4d740c8ae651ac35bbf4d2ed6dc
 /etc/mysql/conf.d/mysqld_safe_syslog.cnf 347fa9f3d579ffc06c39bf7e69f4fc6e
 /etc/logcheck/ignore.d.workstation/mysql-server-5_1 2d34a7ed83fefc165cd1dfea3a72ccc8
 /etc/logcheck/ignore.d.server/mysql-server-5_1 2d34a7ed83fefc165cd1dfea3a72ccc8
 /etc/logcheck/ignore.d.paranoid/mysql-server-5_1 6babe46e791059cdd5a26f4f7fec9eca
 /etc/init.d/mysql ea6d050ac82ed69d01970f9b95ab9b9d
Description: MySQL database server binaries and system database setup
 MySQL is a fast, stable and true multi-user, multi-threaded SQL database
 server. SQL (Structured Query Language) is the most popular database query
 language in the world. The main goals of MySQL are speed, robustness and
 ease of use.
 .
 This package contains all the infrastructure needed to setup system
 databases.
Homepage: http://dev.mysql.com/
Well I did (get rid of it), then service mysql restart, and mysql but it didn't fix anything, same errors.

I've tried this before.
http://askubuntu.com/questions/19595...n-error-code-1
But thanks for the help.

I think that there might be a problem with the admin user tables, they might be inaccessible by permissions to the mysql
 
Old 05-28-2013, 11:01 PM   #4
fortran
Member
 
Registered: Nov 2011
Location: Cairo, Egypt
Distribution: CentOS, RHEL, Fedora
Posts: 300
Blog Entries: 2

Rep: Reputation: 51
What are the permissions of directory /var/lib/mysql/mysql

$ ls -ld /var/lib/mysql/mysql

Last edited by fortran; 05-28-2013 at 11:20 PM.
 
Old 05-28-2013, 11:48 PM   #5
fortran
Member
 
Registered: Nov 2011
Location: Cairo, Egypt
Distribution: CentOS, RHEL, Fedora
Posts: 300
Blog Entries: 2

Rep: Reputation: 51
Run, it may be a fix for you.
sudo chown -R mysql:mysql /var/lib/mysql

sudo service mysql restart

Last edited by fortran; 05-28-2013 at 11:49 PM.
 
Old 05-29-2013, 01:42 AM   #6
eklavya
Member
 
Registered: Mar 2013
Posts: 619

Rep: Reputation: 136Reputation: 136
Quote:
Originally Posted by fortran View Post
sudo chown -R mysql:mysql /var/lib/mysql
Yes this should be a solution of your problem.
As you said, you tempered with the permissions.
The default owner and group for mysql directory is mysql.
If you have changed it to root, it will not work.

If owner and group is still mysql, check the permission.
it should be 700 for /var/lib/mysql or /var/lib/mysql/mysql directory
If it is not 700 then set it
Code:
$ chmod -R 700 /var/lib/mysql/mysql
Now check it again.
 
Old 05-29-2013, 03:33 AM   #7
bloodstreetboy
Member
 
Registered: May 2012
Posts: 198
Blog Entries: 3

Rep: Reputation: 37
Yes remove the part you have pasted here of file /var/lib/dpkg/status
and try to configure again.

Make sure you have taken backup before editing in the file.
 
Old 05-29-2013, 11:31 AM   #8
M4trixSh4d0w
LQ Newbie
 
Registered: Mar 2013
Posts: 14

Original Poster
Rep: Reputation: Disabled
ls -ld /var/lib/mysql/mysql

Code:
drwx------ 2 mysql mysql 4096 May 28 13:38 /var/lib/mysql/mysql
service mysql restart

Code:
Stopping MySQL database server: mysqld.
Starting MySQL database server: mysqld . . . . . . . . . . . . . . failed!
I restarted after chmod -R /var/lib/mysql/mysql but that didn't work either

I took a backup of the file and removed it, but it didn't help.
 
Old 05-30-2013, 01:08 AM   #9
bloodstreetboy
Member
 
Registered: May 2012
Posts: 198
Blog Entries: 3

Rep: Reputation: 37
Then try this...
Code:
$ sudo apt-get --purge remove mysql-server mysql-common mysql-client
$ sudo apt-get install mysql-server mysql-common mysql-client
 
Old 06-02-2013, 08:36 PM   #10
M4trixSh4d0w
LQ Newbie
 
Registered: Mar 2013
Posts: 14

Original Poster
Rep: Reputation: Disabled
I think I am going to just reinstall Debian on my hard drive, I have been having numerous problems with different programs and trying to install them. Thanks for the help though.
 
  


Reply

Tags
mysql


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem finding the mysql executable in Debian Squezee i386 saldarriaga Linux - General 4 06-15-2012 01:25 PM
mysql configuration problem in debian sunils1973 Linux - General 4 07-02-2008 09:27 AM
problem in connect mysql with Qt3 in debian M.A.M Debian 1 02-29-2008 07:06 PM
mysql + debian problem alaios Linux - Software 1 06-09-2005 10:18 AM
Apache / PHP / Mysql config problem - debian bandit Linux - Software 14 09-03-2003 10:04 AM


All times are GMT -5. The time now is 01:03 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration