Search Windows and Linux Networking

Tuesday, April 19, 2011

Installing Mysql on ubuntu 10.10

Installing mysql on ubuntu 10.10


To install mysql on ubuntu run the following command

sudo apt-get install mysql-server-5.1

 
This will install mysql-server during installation. it will ask you root password for sql you can set it or live it blank.

to activate MySQL with the following command:

sudo mysql_install_db

Then run the mysql_secure_installation script to tighten the MySQL server’s security a bit. Follow the default prompts:

mysql_secure_installation

Once this command finishes, you’ll need to log into the MySQL command-line client as the root user:

mysql -u root -p

Enter your MySQL root password. Once logged into the MySQL command line client, you will create a database, a user for that database, and grant all permissions on that database to that user.
First, create the database:

CREATE DATABASE newdatabaser;

(Note that all commands in MySQL must end with a semicolon to denote the end of the SQL statement.)
Create a user who can access the database:

CREATE USER newdatabaseruser;

Next, set a password for the new user:

SET PASSWORD FOR newdatabaseuser= PASSWORD(“password”);

Just as with the root user, you’ll want to choose a strong password. Note that your password will actually go within the quotation marks, and that the password is case-sensitive. For instance, if you were to choose 1234 as your password (an extraordinarily bad idea, incidentally), the command would look like this:

SET PASSWORD FOR newdatabaseuser= PASSWORD(“1234”);

The final step is to grant all privileges on your new database to the testuser by the following command. The password you just assigned the new user will go within the single-quote marks (and, yes, MySQL’s internal syntax isn’t always consistent):

GRANT ALL PRIVILEGES ON newdatabase.* TO newdatabaseuser IDENTIFIED BY ‘password’;

Type exit to close the MySQL client. You’ve now installed MySQL, performed basic configuration, and created a database and user


Ref site:-
http://blog.sudobits.com/2010/10/27/how-to-install-mysql-on-ubuntu-10-10/
http://www.jonathanmoeller.com/screed/?p=2149  Very Good site :-)

No comments:

Post a Comment