How I can set-up MySQL on Lubuntu for education purpose?
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
Vitaly Zdanevich
Updated on September 18, 2022Comments
-
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 over 10 yearsIf you use mysql -u root -p insted of mysqladmin the problem persists?
-
Vitaly Zdanevich over 10 yearsOh, I was wrong - I got 2002 error when
mysql -u root -p
. Whenmysqladmin -u root -p
I got long list with "Administration program for the mysqld daemon". -
Bert over 10 yearsIs 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 over 10 yearsplease 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 over 10 years
sudo service mysql start
-mysql: unrecognized service
-
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 over 10 yearsYes,
not recognized
, but why, if I installed MySQL Community Server from official site? And is not bad that installed Community Server version 6 butsudo apt-get install mysql-server
has version 5.5? Now I installing this. -
Vitaly Zdanevich over 10 yearsInstalled mysql-server. I tried
CREATE DATABASE database1
and after this I have->
symbol and nothing happen. -
Vitaly Zdanevich over 10 yearsOh, I was needed ";" and the end of
CREATE DATABASE database1
. -
Vitaly Zdanevich over 10 yearsI 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 over 10 yearswhen 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..