Install and use Mysql in Ubuntu, using tumysql

Source: Internet
Author: User

Install and use Mysql in Ubuntu, using tumysql
Summary

In this blog post, I will start from the basics and introduce the installation and basic usage commands of Mysql in Linux. It is only applicable to Mysql beginners ......


Install Mysql database

The simplest installation method is described here. for compilation and installation, you can download the installation package ,. /configure generates Makefile, and then make clean, make, make test, and make install. I think these commands should be very basic. I will not explain them here.

1. Installation command

king@king-desktop:~$ sudo apt-get install mysql-server mysql-client


2. Check the database version. The password here is "11"

king@king-desktop:~$ sudo mysqladmin -u root -p versionEnter password: mysqladmin  Ver 8.42 Distrib 5.1.70, for debian-linux-gnu on i486Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

3. view the Mysql service status and start or close the Mysql service.

king@king-desktop:~$ service mysql statusmysql start/running, process 899king@king-desktop:~$ sudo /etc/init.d/mysql start|stop|restart

4. log on to the database and exit the operation.

-U in the Command refers to the user name, here refers to the root,-p followed by the password, here refers to the password set when the database is installed, the author is 11

king@king-desktop:~$ sudo mysql -uroot -p11

5. Basic operations in the database

// Display Database mysql> show databases; + -------------------- + | Database | + -------------------- + | information_schema | jxc | mysql | + ---------------------- + 3 rows in set (0.08 sec) // use a database mysql> use mysqlReading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with-ADatabase changed // create a database mysql> create database thinkphp; query OK, 1 row affec Ted (0.00 sec) // Delete the database mysql> drop database thinkphp; Query OK, 0 rows affected (0.07 sec) // display a table in the database mysql> show tables; // display the structure of a table mysql> describe slow_log; // select the displayed table content mysql> select * from slow_log; Empty set (0.00 sec) // Delete the table mysql> drop table slow_log; // import the database mysql> source/var/www/webPage. SQL; or command :~ $ Sudo mysql-uroot-p11 thinktest <WebPage. SQL

Mysql table structure AUD operation

Add the table field alter table tablename add elemName varchar (10) not null; modify the field type alter table tablename change elemName elemNewName varchar (10) null; alter table tablename modify elemName varchar (10) null; delete a field alter table tablename drop elemName; insert into tablename (elem1, elem2,...) into the data table ,...) values (A, B ,...); delete data in a data table delete from tablename where id> 1 order by time limit 1; UPDATE data in a data table UPDATE tablename SET elem1 = 1, elem2 = 2 WHERE id = 1;



Zookeeper
Install mysql-server in ubuntu

Compile it by yourself. Too many libraries are required. It is best not to use RPM. You can find the DEB package in the ubuntu source of the boss, but the dependency may not be satisfied.

If possible, we recommend that you use analyticdb 5.0 or later. analyticdb 4.0 can be converted to analyticdb 5.0 by using tools.

How can I install a mysql database in linux? My system is ubuntu 10.

The above answer is correct. Is one should be mysql-client-5.1 can also be used, the new to do.
System | System Management | New Software Package Manager
After opening, search for Mysql in the new version to find the related software package.
You can also choose to use the task group management software package from the editing menu.
Select Lamp server! Next, follow the steps to install LAMP with one click.
LAMP, you know!

Related Article

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.