Install MySQL in Ubuntu8.10

Source: Internet
Author: User
Installing the MySQL database in Ubuntu8.10 is very simple. The following is the MySQL installation completed in Ubuntu8.10. the MySQL server should be started automatically. You can run the following command at the terminal prompt to check whether the MySQL server is running: (SEE) sudonetstat-tap | grepmysql when you run this command, you can see lines similar to the following: linuxidc @ linuxidc-la it is very easy to install MySQL database under Ubuntu 8.10.

The following is the MySQL installed in Ubuntu 8.10. the MySQL server should be started automatically.You can run the following command at the terminal prompt to check whether the MySQL server is running: (SEE)

Sudo netstat-tap | grep mysql

When you run this command, you can see a line similar to the following:

Linuxidc @ linuxidc-laptop :~ $ Sudo netstat-tap | grep mysql
[Sudo] password for linuxidc:
Tcp 0 0 localhost: mysql *: * LISTEN 7283/mysqld
Linuxidc @ linuxidc-laptop :~ $

To install MySQL in Ubuntu 8.10, run the following command on the terminal command line: (2)

Sudo apt-get install mysql-server mysql-client

Procedure:

Linuxidc @ linuxidc-laptop :~ $ Sudo apt-get install mysql-server mysql-client
[Sudo] password for linuxidc:
Reading the package list... complete
Analyzing the dependency tree of the software package
Reading status information... complete
The following additional software packages will be installed:
Libdbd-mysql-perl libdbi-perl libnet-daemon-perl libplrpc-perl
Mysql-client-5.0 mysql-server-5.0
Recommended software packages:
Dbishell mysql-doc-5.0 tinyca
The following [new] software packages will be installed:
Libdbd-mysql-perl libdbi-perl libnet-daemon-perl libplrpc-perl mysql-client
Mysql-client-5.0 mysql-server mysql-server-5.0
A total of 0 software packages have been upgraded, 8 new software packages have been installed, 0 software packages have to be uninstalled, and 0 software have not been upgraded.
Download the 35.8 MB software package.
After decompression, 109 MB of extra space is consumed.
Do you want to continue? [Y/n]

Of course, Y is selected. During installation, the software package settings will be displayed. Enter the root password and confirm again. Then confirm (SEE ).

If the server cannot run properly, run the following command to start it:

Sudo/etc/init. d/mysql restart

* Stopping MySQL database server mysqld [OK]
* Starting MySQL database server mysqld [OK]
* Checking for login upt, not cleanly closed and upgrade needing tables.

Configure the MySQL administrator password

Sudo mysqladmin-u root password newpassword

Configure MySQL

Note: by default, MySQL only allows local access. If you want access from other machines, you need to change the/etc/mysql/my. cnf configuration file!

After the default MySQL installation, the root user does not have a password. Therefore, use the root user to enter:

$ Mysql-u root

-U root is used here because I am a general user (firehare). If-u root is not added, mysql will assume that it is a firehare logon. Note: I have not entered the root user mode here because it is unnecessary. In general, it is not necessary to enter the root user mode to operate the database in mysql. This is only possible when the database is set.

If you are using the root user, do not switch the user to the third step.

After entering mysql, the most important thing is to set the root user password in Mysql. Otherwise, the Mysql service is no longer secure.

Mysql> grant all privileges on *. * TO root @ localhost identified by "123456 ";

Note: I use 123456 as the password of the root user.

Use the root user to create the database you need. Here we take xoops as an example:

Mysql> create database xoops; mysql> grant all privileges on xoops. * TO xoops_root @ localhost identified by "654321 ";

In this way, a xoops_roots user is created, which has all permissions on the database xoops. In the future, we will use xoops_root to manage the xoops database, instead of using the root user. This user's permissions will only be limited to the xoops database.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.