Home>

1.Create mariadb.repo under /etc/yum.repos.d/with the following content:

[[email protected] etc] $cd /etc/yum.repos.d
[[email protected] yum.repos.d] $vi mariadb.repo
#mariadb 10.0 centos repository list-created 2013-08-23 13:08 utc
#http://mariadb.org/mariadb/repositories/
[mariadb]
name=mariadb
baseurl=http://yum.mariadb.org/10.0/centos6-amd64
gpgkey=https://yum.mariadb.org/rpm-gpg-key-mariadb
gpgcheck=1

For other operating systems,Information can be found here.

2.Install mariadb using yum

[[email protected] yum.repos.d] $sudo yum -y install mariadb-client mariadb-server mariadb-devel

3. Start the database

[[email protected] yum.repos.d] $sudo service mysql start

4, modify the root password

[[email protected] yum.repos.d] $mysqladmin -u root password "passwd"

5. Configure remote access,mariadb for security reasons,The IP is bound (127.0.0.1) by default.

[[email protected] yum.repos.d] $mysql -u root -p
enter password:
welcome to the mariadb monitor. commands end with;or \ g.
your mariadb connection id is 4
server version:10.0.4-mariadb mariadb server
copyright (c) 2000, 2013, oracle, monty program ab and others.
type "help;" or "\ h" for help. type "\ c" to clear the current input statement.
mariadb [(none)]>grant all privileges on *. * to "root"@"%" identified by "passwd" with grant option;
mariadb [(none)]>flush privileges;

The "%" in the first sentence means that any host can remotely log in to the server and access it.If i want to restrict access to only one machine,Replace it with the corresponding IP, such as:

The second sentence indicates that permission data is reloaded from the grant table of the mysql database.Because mysql puts permissions in the cache, it needs to be reloaded after making changes.

6. If the system's firewall is open (or behind a hardware firewall or nat), you must release the TCP port used by MySQL, which is usually 3306.

7.Case sensitive

After logging in with the root account,Add [lower_case_table_names=1] after [mysqld] in /etc/my.cnf and restart the mysql service. At this time, the setting is successful:the table name is not case sensitive;

The lower_case_table_names parameter is explained in detail:

lower_case_table_names=0

Where 0:case sensitive,1:not case sensitive

  • Previous FullPage Dynamic Scrolling Plugin FullPage Based on JQuery
  • Next Java swing drop menu implementation method