How I can set-up MySQL on Lubuntu for education purpose?

7,306

Get mysql server status by entering sudo service mysqld status

If it is not running start it by entering sudo service mysqld start

If you get service not recognised message, install mysql server by entering:

sudo apt-get install mysql-server

This will install mysql, then start it by entering sudo service mysqld start

Share:
7,306
Vitaly Zdanevich
Author by

Vitaly Zdanevich

Updated on September 18, 2022

Comments

  • Vitaly Zdanevich
    Vitaly Zdanevich about 1 year

    I have Lubuntu 12.10 x86 on my notebook with all updates. I downloaded and install MySQL Community Server and MySQL Workbench. I learning Java and our next lesson will be about MySQL. I need to prepare - create test database. If I understand - I need use terminal for creating database? I tried mysql -u root -p and after entering password I get: ERROR 2002 (HYOOO) Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2). And I don't have this directory: /var/run/mysqld/mysqld.sock.

    I read some pages about this problem and it is not still repaired.

    • Jesse
      Jesse over 10 years
      If you use mysql -u root -p insted of mysqladmin the problem persists?
    • Vitaly Zdanevich
      Vitaly Zdanevich over 10 years
      Oh, I was wrong - I got 2002 error when mysql -u root -p. When mysqladmin -u root -p I got long list with "Administration program for the mysqld daemon".
    • Bert
      Bert over 10 years
      Is the MySQL server running? Make sure it is running by using the command sudo service mysql start Did you download/install the program from MySQL's website, or use the packages from Ubuntu, either through Software Center or apt-get?
    • Rinzwind
      Rinzwind over 10 years
      please do a ps -ef | grep mysql on command line. If it returns no process mysql is NOT running (or not installed). If so see user1262738's answer .
    • Vitaly Zdanevich
      Vitaly Zdanevich over 10 years
      sudo service mysql start - mysql: unrecognized service
    • Vitaly Zdanevich
      Vitaly Zdanevich over 10 years
      ps -ef | grep mysql - vitaly 2304 2253 0 18:28 pts/0 00:00:00 grep --color=auto mysql
  • Vitaly Zdanevich
    Vitaly Zdanevich over 10 years
    Yes, not recognized, but why, if I installed MySQL Community Server from official site? And is not bad that installed Community Server version 6 but sudo apt-get install mysql-server has version 5.5? Now I installing this.
  • Vitaly Zdanevich
    Vitaly Zdanevich over 10 years
    Installed mysql-server. I tried CREATE DATABASE database1 and after this I have -> symbol and nothing happen.
  • Vitaly Zdanevich
    Vitaly Zdanevich over 10 years
    Oh, I was needed ";" and the end of CREATE DATABASE database1.
  • Vitaly Zdanevich
    Vitaly Zdanevich over 10 years
    I connected Workbench to my created database, and I prepared for course. Only question that I have - why I was needed make sudo apt-get install mysql-server if I had installed MySQL Community Edition?
  • Hojat Taheri
    Hojat Taheri over 10 years
    when you install community edition you have to start the daemon, ubuntu packages are ready to use in services, it is always a better way to install from apt repository because configuration files for that specific distro are ready to use..