Learn Linux notes (v)-mysql application

Source: Internet
Author: User

To query whether MySQL is installed:

#rpm-qa MySQL;

If you have already installed, delete the command:

#rpm-e--nodeps MySQL (--nodeps is forced to delete)

There is also the command line for database backup and recovery:Backup:

#mysqldump-u root-p password database name >data.bak (table is zebra.users)
Recovery:

#mysql-u root-p password database name <data.bak


Here, in general, we will assign a group to MySQL to manage, security highs.
#groupadd MySQL
#useradd-G MySQL MySQL
Go to the MySQL folder to start the installation:
#scripts/mysql_install_db--user=mysql (Initialize database)
#chown-R Root. (. Is the current folder, modify the owner of the file)
#chown-R MySQL data. (Modify the owner of the Data folder to give the database management to MySQL)
#chgrp-R MySQL. (change user group)
Start MySQL: #bin/mysql_safe--user=mysql &
Modify the configuration, point the path to the MySQL execution directory, and the implementation can enter MySQL in any directory:

#cd/root/.bash_profile in this file add:/home/mysql/bin (is the MySQL installation directory), and finally use #env to see if there is a MySQL path in the configuration bin, then it can be tested. Ubantu system slightly different, the same logic, but Google.


To test the MySQL project, note that the MySQL driver jar package is placed in the/jdk/lib/ext/directory.

Learn Linux notes (v)-mysql application

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.