Linux on-load MySQL database

Source: Internet
Author: User
Tags import database

The application of MySQL database under Linux has always been a tricky one for me, and this time I built Linux learning environment by studying and learning MySQL database and installing and uninstalling it under Linux.

1, first look at unloading it, as shown:

  

The above commands are at a glance, note that the configuration file/etc/my.cnf and the database file/var/lib/mysql need to be deleted after the uninstallation is complete.

Sometimes when CentOS comes with MySQL uninstall, there is no uninstall situation,

[Email protected]~]# Rpm-ev mysql-libs-5.1.66-2.el6_3.x86_64
error:failed dependencies:
libmysqlclient.so.16 () (64bit) is needed by (installed) postfix-2:2.6.6-2.2.el6_1.x86_64
libmysqlclient.so.16 (libmysqlclient_16) (64bit) is needed by (installed) postfix-2:2.6.6-2.2.el6_1.x86_64
Mysql-libs is needed by (installed) postfix-2:2.6.6-2.2.el6_1.x86_64 situation

Workaround:rpm-e--nodeps mysql-libs-5.1.66-2.el6_3.x86_64

2, again to explain the installation bar, first download the following two RPM package, here is mainly in RPM installation way to explain, about the source package installation method later.

  

Install the server-side program first, as shown in the following:

  

After the server-side installation is complete, the/usr/share/ A MySQL startup script mysql.server and some sample configuration files are generated in the MySQL directory, and there is a profile my-medium.cnf, because the MySQL installation is done by default as a system service, so it is necessary to place the configuration file in the relevant directory of the system service as follows Operation:

CP/USR/SHARE/MYSQL/MY-MEDIUM.CNF/ETC/MY.CNF, renamed MY.CNF as the MySQL configuration file.

Below is a look at how to start and stop the MySQL service as shown in:

  

The installation configuration to this MySQL server is complete.

3. Install the MySQL client program

The install command is the same as the server: RPM-IVH mysql-client-5.5.8-1.linux2.6.i386.rpm

MySQL installation also after the directory structure is as follows:

  

Server program for/USR/SBIN/MYSQLD

The data directory is/var/lib/mysql, and by default the log files are stored under/var/lib/mysql, and if you want to change their location, you can change the/ETC/MY.CNF configuration file implementation.

4, log in MySQL database, the default installation is completed after the user name is root mysql, password is empty, so if the installation successful after the login should be as shown:

  

The MySQL database has been successfully logged in as shown.

5, after logging into the database, import database script, the command is as follows:

Source/root/test.sql, complete.

About whether you need to configure the JSP and MySQL connection in Linux, because the program has written a connection to the database program, so there is no need to set anything here, only need to adjust the database configuration file in the connection address.

The installation and uninstallation process of MySQL is included in the summary.

Linux on-load MySQL database

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.