Jei forume lankaisi pirmą kartą, kviečiame registruotis ir prisijungti prie diskusijų.
PrisijungtiRegistruotisJei forume lankaisi pirmą kartą, kviečiame registruotis ir prisijungti prie diskusijų.
mysqldump -u root -p --all-databases > alldb.sq
[COLOR="DarkSlateGray"]-- Warning: Skipping the data of table mysql.event. Specify the --events option explicitly.l[/COLOR]
cp -r /var/lib/mysql /var/lib/mysql.bak
service mysqld stop
[COLOR="DarkSlateGray"]Stopping mysqld: [ [COLOR="Lime"]OK[/COLOR] ][/COLOR]
chkconfig mysqld off
cp /etc/my.cnf /etc/my.cnf.old
yum remove mysql* mysql-server mysql-devel mysql-libs
vi /etc/yum.repos.d/mariadb.repo
Įterpiame:
# MariaDB 5.5 CentOS repository list - created 2013-06-06 07:42 UTC
# http://mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/5.5/centos6-x86
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
vi /etc/yum.repos.d/mariadb.repo
Įterpiame:
# MariaDB 5.5 CentOS repository list - created 2013-06-06 07:53 UTC
# http://mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/5.5/centos6-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
yum update
yum install MariaDB-devel MariaDB-client MariaDB-server -y
service mysql start
[COLOR="DarkSlateGray"]Starting MySQL...... SUCCESS! [/COLOR]
chkconfig mysql on
/usr/bin/mysql_secure_installation
[COLOR="DarkSlateGray"]/usr/bin/mysql_secure_installation: line 379: find_mysql_client: command not found
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none):
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.
You already have a root password set, so you can safely answer 'n'.
Change the root password? [Y/n] [COLOR="Black"]y[/COLOR]
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!
By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] [COLOR="Black"]y[/COLOR]
... Success!
Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] [COLOR="Black"]y[/COLOR]
... Success!
By default, MariaDB comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] [COLOR="Black"]y[/COLOR]
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] [COLOR="Black"]y[/COLOR]
... Success!
Cleaning up...
All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB![/COLOR]
[root@server ~]# cp /etc/my.cnf.old /etc/my.cnf
[COLOR="DarkSlateGray"]cp: overwrite `/etc/my.cnf'?[/COLOR] y
cp /etc/my.cnf.rpmsave /etc/my.cnf
[COLOR="DarkSlateGray"]cp: overwrite `/etc/my.cnf'[/COLOR]? y
mysql -u root -p < alldb.sql
[COLOR="DarkSlateGray"]Enter password:[/COLOR]
[root@server ~]# service mysql restart
[COLOR="DarkSlateGray"]Shutting down MySQL.. SUCCESS!
Starting MySQL...... SUCCESS![/COLOR]
mysql -u root -p
[COLOR="DarkSlateGray"]Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 2
Server version: [B]5.5.31-MariaDB MariaDB Server[/B]
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)]> [/COLOR]
MariaDB [(none)]> show databases;
[COLOR="DarkSlateGray"]+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| test |
| wordpress |
+--------------------+
4 rows in set (0.00 sec)[/COLOR]
MariaDB [(none)]> status;
[COLOR="DarkSlateGray"]--------------
mysql Ver 15.1 Distrib 5.5.31-MariaDB, for Linux (x86_64) using readline 5.1
Connection id: 2
Current database:
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server: [B]MariaDB[/B]
Server version: [B]5.5.31-MariaDB MariaDB Server[/B]
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: latin1
Db characterset: latin1
Client characterset: utf8
Conn. characterset: utf8
UNIX socket: /var/lib/mysql/mysql.sock
Uptime: 4 min 6 sec
Threads: 1 Questions: 182 Slow queries: 0 Opens: 9 Flush tables: 2 Open tables: 17 Queries per second avg: 0.739
--------------[/COLOR]
MariaDB [(none)]> use wordpress;
[COLOR="DarkSlateGray"]Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
MariaDB [wordpress]> show tables;
+-----------------------+
| Tables_in_wordpress |
+-----------------------+
| wp_commentmeta |
| wp_comments |
| wp_links |
| wp_options |
| wp_postmeta |
| wp_posts |
| wp_term_relationships |
| wp_term_taxonomy |
| wp_terms |
| wp_usermeta |
| wp_users |
+-----------------------+
11 rows in set (0.00 sec)[/COLOR]