Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: Problem with MySQL

  1. #1

    Default Problem with MySQL

    Hi guys, I tryed to install MySQL, but I think I messed something up. First I installed Apache2 and PHP 5. Next, I installed MariaDB unintentionally, I ran "mysql_secure_installation" script and in the end it said something about "MariaDB", then I realized I've installed the wrong database and removed the package MariaDB. Afterwards, I installed the packages "mysql-community-server" and "mysql-community-server-client", but now I think something is messed up. When I try to run "mysql_secure_installation" script, it doesn't accept my previous root password (or no password) and it returns this error:

    Code:
    Enter current password for root (enter for none): ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)
    The file "/var/run/mysql/mysql.sock" doesn't exist. MySQL doesn't seem to be running either (although I programmed it to autostart with the commands "insserv mysql" and "chkconfig --add mysql"):

    Code:
     # mysqladmin -u root -p statusEnter password: 
    mysqladmin: connect to server at 'localhost' failed
    error: 'Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)'
    Check that mysqld is running and that the socket: '/var/run/mysql/mysql.sock' exists!
    I'm new to OpenSUSE. Could somebody please help me?

  2. #2
    Join Date
    Jun 2008
    Location
    Groningen, Netherlands
    Posts
    20,925
    Blog Entries
    14

    Default Re: Problem with MySQL

    Use Yast - System - Services manager to start MySQL. But ...... things should work flawlessly with MariaDB.
    ° Appreciate my reply? Click the star and let me know why.

    ° Perfection is not gonna happen. No way.

    http://en.opensuse.org/User:Knurpht
    http://nl.opensuse.org/Gebruiker:Knurpht

  3. #3

    Default Re: Problem with MySQL

    Quote Originally Posted by renatov View Post
    Hi guys, I tryed to install MySQL, but I think I messed something up. First I installed Apache2 and PHP 5. Next, I installed MariaDB unintentionally, I ran "mysql_secure_installation" script and in the end it said something about "MariaDB", then I realized I've installed the wrong database and removed the package MariaDB. Afterwards, I installed the packages "mysql-community-server" and "mysql-community-server-client", but now I think something is messed up. When I try to run "mysql_secure_installation" script, it doesn't accept my previous root password (or no password) and it returns this error:

    Code:
    Enter current password for root (enter for none): ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)
    Apparently MySQL is not running.
    I think it fails to start because you had MariaDB installed and it already has created its databases which MySQL cannot upgrade.
    Is there any reason why MariaDB is "the wrong database"? Or are you just thinking that because of the different name?
    MariaDB is the default on openSUSE (and many other distributions) and started as a fork of MySQL by its original author. And it is compatible to all clients.

    If you really want to use MySQL I would suggest to just remove all database files, since you apparently don't have any data in them yet anyway.
    Just remove the directory /var/lib/mysql/ (as root) and restart MySQL, it should work then.
    Code:
    sudo rm -r /var/lib/mysql
    sudo systemctl start mysql.service

  4. #4

    Default Re: Problem with MySQL

    Quote Originally Posted by Knurpht View Post
    Use Yast - System - Services manager to start MySQL. But ...... things should work flawlessly with MariaDB.
    It gives an error too, I took a print screen: http://imageshack.com/a/img834/3139/rlq4.png

  5. #5

    Default Re: Problem with MySQL

    Quote Originally Posted by renatov View Post
    It gives an error too, I took a print screen: http://imageshack.com/a/img834/3139/rlq4.png
    That just shows what I suspected.
    The upgrade of the databases fails.

    So see my previous post.
    If you don't want to switch back to MariaDB or wipe out your database tables, you might also be able to get it going by only removing the file /var/lib/mysql/.run-mysql_upgrade:
    Code:
    sudo rm /var/lib/mysql/.run-mysql_upgrade
    This worked for me at least (I had the same problem when upgrading from MySQL 5.5/oS 12.3 to MySQL 5.6/oS 13.1). But I switched to MariaDB since then and don't regret it.

  6. #6

    Default Re: Problem with MySQL

    Quote Originally Posted by wolfi323 View Post
    Apparently MySQL is not running.
    I think it fails to start because you had MariaDB installed and it already has created its databases which MySQL cannot upgrade.
    Is there any reason why MariaDB is "the wrong database"? Or are you just thinking that because of the different name?
    MariaDB is the default on openSUSE (and many other distributions) and started as a fork of MySQL by its original author. And it is compatible to all clients.

    If you really want to use MySQL I would suggest to just remove all database files, since you apparently don't have any data in them yet anyway.
    Just remove the directory /var/lib/mysql/ (as root) and restart MySQL, it should work then.
    Code:
    sudo rm -r /var/lib/mysql
    sudo systemctl start mysql.service
    It worked!! I was able to run "mysql_secure_instalation" script too

    I'm actually a newbie in this issue and I don't know the difference between MariaDB and MySQL. The reason I wanted to install MySQL is because I'm currently reading this book and within a couple of days I'll be reaching MySQL chapters. I'll be learning the language and how everything works, if MariaDB is incompatible with some minor aspect, I won't be able to tell if I'm doing something wrong or if there are incompatibility issues. That's why I prefered to install directly MySQL. Does it make sense? Or my worries do not proceed?

  7. #7

    Default Re: Problem with MySQL

    Quote Originally Posted by wolfi323 View Post
    That just shows what I suspected.
    The upgrade of the databases fails.

    So see my previous post.
    If you don't want to switch back to MariaDB or wipe out your database tables, you might also be able to get it going by only removing the file /var/lib/mysql/.run-mysql_upgrade:
    Code:
    sudo rm /var/lib/mysql/.run-mysql_upgrade
    This worked for me at least (I had the same problem when upgrading from MySQL 5.5/oS 12.3 to MySQL 5.6/oS 13.1). But I switched to MariaDB since then and don't regret it.
    Yes, that worked, thank you very much for your help! Sorry I didn't reply earlier, I am a bit slow when I'm writing in English.

  8. #8

    Default AW: Re: Problem with MySQL

    Quote Originally Posted by renatov View Post
    I'm actually a newbie in this issue and I don't know the difference between MariaDB and MySQL. The reason I wanted to install MySQL is because I'm currently reading this book and within a couple of days I'll be reaching MySQL chapters. I'll be learning the language and how everything works, if MariaDB is incompatible with some minor aspect, I won't be able to tell if I'm doing something wrong or if there are incompatibility issues. That's why I prefered to install directly MySQL. Does it make sense? Or my worries do not proceed?
    From a client's or user's perspective they should be exactly the same. But internal storage formats may be different, so the files on the hard disk might not be compatible any more (when MariaDB was first released they were, because as I said, MariaDB is actually a fork of MySQL by MySQL's original developer).

  9. #9

    Default Re: AW: Re: Problem with MySQL

    Quote Originally Posted by wolfi323 View Post
    From a client's or user's perspective they should be exactly the same. But internal storage formats may be different, so the files on the hard disk might not be compatible any more (when MariaDB was first released they were, because as I said, MariaDB is actually a fork of MySQL by MySQL's original developer).
    The book I'm reading comes with a CD and a bunch of codes and other files... I think I'll use MySQL at least for a while. Do you know any good article that points the differences between MySQL and MariaDB, and why the team forket MySQL project?

  10. #10

    Default Re: Problem with MySQL

    Quote Originally Posted by renatov View Post
    The book I'm reading comes with a CD and a bunch of codes and other files... I think I'll use MySQL at least for a while. Do you know any good article that points the differences between MySQL and MariaDB, and why the team forket MySQL project?
    Sorry I can't, maybe someone else can.
    This maybe?
    https://mariadb.com/kb/en/mariadb-versus-mysql/
    or this?
    http://it.toolbox.com/blogs/oracle-g...nd-mysql-55291

    But I think at least one of the reasons why the original developer forked MySQL was because MySQL was taken over by Oracle.

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •