0

I have done the following:

shell> sudo apt-get install mysql-server-core-5.1
shell> sudo apt-get install mysql-client-core-5.1

Both seemed to complete fine with no errors. I have the following present:

/usr/sbin/mysqld

However if I try to run this, I get the following error:

mysqld: Can't change dir to '/var/lib/mysql/' (Errcode: 2)

for the simple reason that in fact this directory does not exist. Now the correct way to start the daemon is apparently:

/etc/init.d/mysql start

however this script does not seem to exist either. So has my install totally messed up, or is there a step I am missing?

Thanks

Richard
  • 3,892
  • 2
  • 18
  • 13

2 Answers2

4

The way to install MySql on Ubuntu 10.04 is as follows:

shell> sudo apt-get install mysql-server

which will install everything, client and dependencies. You will prompted for a root password duing install. And that's it. When the install has completed mysqld will be up and running, and will start on boot. To connect to it:

shell> mysql -u root -p

and then add other users as you like.

Richard
  • 3,892
  • 2
  • 18
  • 13
0

You need to start mysql by using sudo. The easiest way is

sudo start mysql

Daemons usually always have to started with root privileges.

However, after the installation, the mysql daemon (mysqld) is very liklely already running. You can check this out with

sudo status mysql
txwikinger
  • 943
  • 7
  • 14