Install mysql in Ubuntu

Source: Internet
Author: User
I. Introduction Java is cross-platform, but most JavaBS programs are deployed on the Linux platform, because Linux has the advantages of open source and free of charge. So I decided to use the Linux system when learning Java. Mysql is a frequently used database program. The following describes how to install mysql in Ubuntu as a reference. Ii. Installation

I. Introduction Java is cross-platform, but most Java B/S programs are deployed on the Linux platform, because Linux has the advantages of open source and free of charge. So I decided to use the Linux system when learning Java. Mysql is a frequently used database program. The following describes how to install mysql in Ubuntu as a reference. Ii. Installation

I. Introduction

Java is cross-platform, but most Java B/S programs are deployed on the Linux platform, because Linux has the advantages of open source and free. So I decided to use the Linux system when learning Java. Mysql is a frequently used database program. The following describes how to install mysql in Ubuntu as a reference.

Ii. Install Mysql

1. install two programs to install MySQL:
Mysql-server and mysql-client

2. Install MySQL

First, check whether mysql exists. Enter the command sudo netstat-tap | grep mysql.

If no, enter sudo apt-get install mysql-server mysql-client.

  
During installation, you will be prompted to enter the root user password.

After installation, enter sudo netstat-tap | grep myslq again, for example:


Use the following command to connect to mysql and test whether the connection is successful.

3. log on to MySQL

The command used to log on to MySQL is mysql. the syntax of mysql is as follows:
Mysql [-u username] [-h host] [-p [password] [dbname]
Username and password are the usernames and passwords of MySQL respectively.


The prompt "mysql>" appears. Congratulations! The installation is successful!

  4. Several important MySQL Directories

After MySQL is installed, its database files, configuration files, and command files are not installed in the same directory as SQL Server by default. It is very important to understand these directories, especially for Linux beginners, the directory structure of Linux itself is complicated. If you cannot figure out the installation directory of MySQL, you won't be able to learn it in depth.

The following describes these directories.

1. Database directory
/Var/lib/mysql/

2. Configuration File
/Usr/share/mysql (mysql. server command and configuration file)

3. Related commands
/Usr/bin (commands such as mysqladmin mysqldump)

4. Start the script
/Etc/rc. d/init. d/(directory for starting the script file mysql)

5. Install the GUI management tool for mysql in Ubuntu

A good graphical interface management tool for MySql in Linux

For Web development, databases are essential. A good graphic interface tool for databases can greatly improve the development efficiency. In the past, a tool named Navicat was commonly used in Windows operating systems, which is very useful, but it is billed. When I switched to the Ubuntu system, I first found a mysl browser in the Ubuntu Software Center. It is not very useful, the font is too small, and the function is not strong. Later, I learned that MySql has its own graphical interface tool WorkBench, which is very powerful and easy to use. Click to open the link.

Official introduction:

MySQL Workbench provides DBAs and developers an integrated tools environment:

  • Database Design & Modeling
  • SQL Development (replacing MySQL Query Browser)
  • Database Administration (replacing MySQL Administrator)
  • Database Migration

The Community (OSS) Edition is available from this page under the GPL.

Welcome Page

SQL Development page

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.