LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 09-21-2012, 03:45 PM   #1
jim.thornton
Member
 
Registered: May 2007
Posts: 430

Rep: Reputation: 19
Major frustration: Can't get MySql installed and working


Ubuntu 12.04 LTS
384MB Ram
Burstable 1GB
VPS => OpenVZ

I have been searching and searching for the solutions to this but have hit a dead end. It seems to be one problem after another. I'm trying to setup a server ISPConfig 3 and during the installation it said that MySQL was not installed. I was surprised because everything that I have read said that it was installed by default with U 12.04.

I used apt-get to install mysql-server mysql-common mysql-client and it went through everything. A page popped up wanting to set the root password and that kept failing. Finally, I purged everything mysql and started over. I re-installed and this time after the error I ran $ mysql_install_db and that resulted in the following output:
Code:
Installing MySQL system tables...
OK
Filling help tables...
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h vpsgrid password 'new-password'

Alternatively you can run:
/usr/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl

Please report any problems with the /usr/scripts/mysqlbug script!
I then tried to reset the password via the commandline which resulted in the following output:
Code:
sudo /usr/bin/mysqladmin -u root password passwordhere
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
I then ran $ sudo mysql_secure_installation which resulted in the following output:
Code:
sudo mysql_secure_installation
touch: cannot touch `.my.cnf.4676': No such file or directory
touch: cannot touch `.mysql.4676': No such file or directory
chmod: cannot access `.my.cnf.4676': No such file or directory
chmod: cannot access `.mysql.4676': No such file or directory




NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!


In order to log into MySQL to secure it, we'll need the current
password for the root user.  If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none): 
/usr/bin/mysql_secure_installation: 85: /usr/bin/mysql_secure_installation: cannot create .my.cnf.4676: Directory nonexistent
/usr/bin/mysql_secure_installation: 86: /usr/bin/mysql_secure_installation: cannot create .my.cnf.4676: Directory nonexistent
/usr/bin/mysql_secure_installation: 87: /usr/bin/mysql_secure_installation: cannot create .my.cnf.4676: Directory nonexistent
/usr/bin/mysql_secure_installation: 89: /usr/bin/mysql_secure_installation: cannot create .my.cnf.4676: Directory nonexistent
/usr/bin/mysql_secure_installation: 58: /usr/bin/mysql_secure_installation: cannot create .mysql.4676: Directory nonexistent
/usr/bin/mysql_secure_installation: 60: /usr/bin/mysql_secure_installation: cannot open .mysql.4676: No such file
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.

Set root password? [Y/n] Y
New password: 
Re-enter new password: 
/usr/bin/mysql_secure_installation: 58: /usr/bin/mysql_secure_installation: cannot create .mysql.4676: Directory nonexistent
/usr/bin/mysql_secure_installation: 60: /usr/bin/mysql_secure_installation: cannot open .mysql.4676: No such file
Password update failed!
Can someone please help me. It seems like one problem after another after another after another.... You get the picture.
 
Old 09-21-2012, 05:52 PM   #2
cpasqualini
Member
 
Registered: Dec 2010
Location: Concordia, Entre Ríos, Argentina
Distribution: Debian
Posts: 46

Rep: Reputation: 5
i don't understand what goes wrong in your install, because normally it's a really simple task to get mysql running on a debian/ubuntu installation.

as i can see you had run
Code:
$ mysql_install_db
but that $ makes me think that you had run that command without root permissions (without sudo).

i'm more a Debian admnistrator than ubuntu one, so normally i execute
Code:
sudo su -
and get a root shell.


for installing mysql you just need to run (as root):
Code:
apt-get install mysql-server
it will take automatically all the dependencies, including mysql-client.

if you have it already installed you can try (as root):
Code:
dpkg-reconfigure mysql-server
if that doesn't show you any debconf interface, can be because mysql-server it's a meta-package depending on the real mysql-server that have been installed. As an example, on an old ubuntu 10.10 machine i have running:
Code:
$ dpkg-query -l |grep mysql-server
ii  mysql-server                                         5.1.61-0ubuntu0.10.10.1                                  MySQL database server (metapackage depending on the latest version)
ii  mysql-server-5.1                                     5.1.61-0ubuntu0.10.10.1                                  MySQL database server binaries and system database setup
ii  mysql-server-core-5.1                                5.1.61-0ubuntu0.10.10.1                                  MySQL database server binaries
$ sudo dpkg-reconfigure mysql-server-5.1
[dialog screen asking for mysql's root password (twice)]
mysql stop/waiting
mysql start/running, process 18003
$ ps ax|grep mysql
18003 ?        Ssl    0:00 /usr/sbin/mysqld
18040 pts/2    S+     0:00 grep --color=auto mysql
please note that i had run those command with local user permissions and not on root's shell

in debian, you need to do the Debian way, the original package way not work every time..

besides that, i have found an affirmation that you must confirm:
http://wiki.debian.org/MySql: MySql will only install if you have a NON-NUMERIC hostname that is resolvable via the /etc/host file


please try that commands an dump here some more info


best regards

Last edited by cpasqualini; 09-21-2012 at 05:54 PM.
 
Old 09-21-2012, 11:20 PM   #3
jim.thornton
Member
 
Registered: May 2007
Posts: 430

Original Poster
Rep: Reputation: 19
Thank you for pointing me in that direction. After reading your post I started working on other things and I started searching for other terms with regards to other errors I was getting.

FYI: It all came down to InnoDB was failing to start. I added the following two lines to my.cnf under the [mysqld] section and it started right up:

ignore_builtin_innodb
default_storage_engine = MyISAM
 
  


Reply



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
Major problems with GRUB - cannot access my other installed distros redandwhitestripes Linux - General 10 01-27-2009 04:42 AM
Frustration: Can't connect to local MySQL server through socket '/usr/local/mysql-5.0 nidala Linux - Newbie 1 09-27-2008 11:20 PM
mysql update brought major performance problems LidoShuffle Linux - Server 5 03-27-2008 03:05 PM
Apache + Orion + SSL = Major Frustration SoulGrind Linux - Networking 3 10-12-2006 06:15 PM
Frustration: Santa Cruz sound card not working Meowatilla Fedora 9 04-15-2004 03:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:23 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
Open Source Consulting | Domain Registration