Linux Mysql knowledge

Source: Internet
Author: User

1. Check whether Mysql is installed in Linux.

[Root @ localhost zhoulinghong] # rpm-qa | grep MySQL

MySQL-server-community-5.1.22-0.rhel4

Already installed.

2. Install mysql (rpm) in Linux)

[Root @ localhost zhoulinghong] # rpm-ivh MySQL-server-community-5.1.22-0.rhel4.i386.rpm

Warning: MySQL-server-community-5.1.22-0.rhel4.i386.rpm: V3 DSA signature: NOKEY, key ID 5072e1f5

Error: Failed dependencies:

Perl (DBI) is needed by MySQL-server-community-5.1.22-0.rhel4.i386

Suggested resolutions:

Perl-DBI-1.40-5.i386.rpm

Haha, an error occurred. The disadvantages of Linux have emerged. Software Installation is too dependent on each other... The error message above shows that the perl-DBI-1.40-5.i386.rpm package is missing. There is no way to install

3. Install the dependency package

Perl-DBI-1.40-5.i386.rpm this package is in RedHat's CD2. You don't have to think about mounting the optical drive.

[Root @ localhost mnt] # mount/dev/cdrom/mnt/cdrom

After the mounting is successful. Go to the/mnt/cdrom/RedHat/RPMS directory and there is a perl-DBI-1.40-5.i386.rpm for this package.

[Root @ localhost RPMS] # rpm-ivh perl-DBI-1.40-5.i386.rpm

Warning: perl-DBI-1.40-5.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e

Preparing... ######################################## ### [100%]

1: perl-DBI ##################################### ###### [100%]

The installation is successful.

OK. Now the dependency package has been installed, and mysql can be installed. (Note: because the environment is different, other dependent Packages may need to be installed in the middle, and the method should be taken as above .)

4. Install Mysql

[Root @ localhost zhoulinghong] # rpm-ihv MySQL-server-community-5.1.22-0.rhel4.i386.rpm

Warning: MySQL-server-community-5.1.22-0.rhel4.i386.rpm: V3 DSA signature: NOKEY, key ID 5072e1f5

Preparing... ######################################## ### [100%]

1: mySQL-server-community ################################### ####### [1, 100%]

Please remember to set a password for the MySQL root USER!

To do so, start the server, then issue the following commands:

/Usr/bin/mysqladmin-u root password 'new-password'

/Usr/bin/mysqladmin-u root-h localhost. localdomain password 'new-password'

See the manual for more instructions.

Please report any problems with the/usr/bin/mysqlbug script!

The latest information about MySQL is available on the web

Http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

Notes regarding SELinux on this platform:

========================================================== =

The default policy might cause server startup to fail because it is

Not allowed to access critical files. In this case, please update

Your installation.

The default policy might also cause inavailability of SSL related

Features because the server is not allowed to access/dev/random

And/dev/urandom. If this is a problem, please do the following:

1) install selinux-policy-targeted-sources from your OS vendor

2) add the following two lines to/etc/selinux/targeted/src/policy/domains/program/mysqld. te:

Allow mysqld_t random_device_t: chr_file read;

Allow mysqld_t urandom_device_t: chr_file read;

3) cd to/etc/selinux/targeted/src/policy and issue the following command:

Make load

Starting MySQL [OK]

Giving mysqld 2 seconds to start

Obviously, the installation is successful. If the installation fails, you can uninstall it once. there is basically no problem after the installation.

  • 1
  • 2
  • Next 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.