Linux basic configurations - MariaDB en Configure MariaDB in Slackware 14.1 <!-- google_ad_section_start --><div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>MariaDB is a default database server pre-configured in Slackware 14.1 replacing the MySQL server. This tutorial will guide a Slackware beginner on how to setup and configure MariaDB in the most basic way. Oh don't worry about the command. MariaDB uses <em>mysql</em> as well. Let's begin the first step:</p> <p>1- Install MariaDB system database:</p> <table><tr><td><code>root@slackware:~# <span style="color:red;">mysql_install_db --user=mysql</span><br /> Installing MariaDB/MySQL system tables in '/var/lib/mysql' ...<br /> OK<br /> Filling help tables...<br /> OK<br /><br /> To start mysqld at boot time you have to copy<br /> support-files/mysql.server to the right place for your system<br /><br /> PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !<br /> To do so, start the server, then issue the following commands:<br /><br /> '/usr/bin/mysqladmin' -u root password 'new-password'<br /> '/usr/bin/mysqladmin' -u root -h slackware password 'new-password'<br /><br /> Alternatively you can run:<br /> '/usr/bin/mysql_secure_installation'<br /><br /> which will also give you the option of removing the test<br /> databases and anonymous user created by default. This is<br /> strongly recommended for production servers.<br /><br /> See the MariaDB Knowledgebase at or the<br /> MySQL manual for more instructions.<br /><br /> You can start the MariaDB daemon with:<br /> cd '/usr' ; /usr/bin/mysqld_safe --datadir='/var/lib/mysql'<br /><br /> You can test the MariaDB daemon with<br /> cd '/usr/mysql-test' ; perl<br /><br /> Please report any problems with the '/usr/bin/mysqlbug' script!<br /><br /> The latest information about MariaDB is available at<br /> You can find additional information about the MySQL part at:<br /><br /> Support MariaDB development by buying support/new features from<br /> Monty Program Ab. You can contact us about this at<br /> Alternatively consider joining our community based development effort:<br /><br /><br /> root@slackware:~#<br /></code></td> </tr></table><p>2- Start MariaDB daemon. We need to make mysql daemon script executable to make it start at boot: </p> <table><tr><td><code>root@slackware:~# <span style="color:red;">chmod 755 /etc/rc.d/rc.mysqld </span><br /> root@slackware:~#<br /></code></td> </tr></table><p>Now we can start the daemon:</p> <table><tr><td><code>root@slackware:~# <span style="color:red;">/usr/bin/mysqld_safe --datadir='/var/lib/mysql' </span><br /> [1] 1714<br /> root@slackware:~# 140105 12:48:13 mysqld_safe Logging to '/var/lib/mysql/slackware.err'.<br /> 140105 12:48:13 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql<br /></code></td> </tr></table><p>3- Set root password or better, we can run '/usr/bin/mysql_secure_installation' which provides more options. The below example shows a finished running tool. You can choose what you want to do with your system.</p> <table><tr><td><code>root@slackware:~# <span style="color:red;">/usr/bin/mysql_secure_installation</span><br /> /usr/bin/mysql_secure_installation: line 379: find_mysql_client: command not found<br /><br /> NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB<br /> SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!<br /><br /> In order to log into MariaDB to secure it, we'll need the current<br /> password for the root user. If you've just installed MariaDB, and<br /> you haven't set the root password yet, the password will be blank,<br /> so you should just press enter here.<br /><br /> Enter current password for root (enter for none): <span style="color:red;">Just press Enter here</span><br /> OK, successfully used password, moving on...<br /><br /> Setting the root password ensures that nobody can log into the MariaDB<br /> root user without the proper authorisation.<br /><br /> Set root password? [Y/n] <span style="color:red;">Y</span><br /> New password: <span style="color:red;">Enter password for MariaDB. It's invisible</span><br /> Re-enter new password: <span style="color:red;">Repeat password for MariaDB. It's invisible</span><br /> Password updated successfully!<br /> Reloading privilege tables..<br /> ... Success!<br /><br /> 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.<br /><br /> Remove anonymous users? [Y/n] <span style="color:red;">Y</span><br /> ... Success!<br /><br /> Normally, root should only be allowed to connect from 'localhost'. This<br /> ensures that someone cannot guess at the root password from the network.<br /><br /> Disallow root login remotely? [Y/n] <span style="color:red;">Y</span><br /> ... Success!<br /><br /> 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.<br /><br /> Remove test database and access to it? [Y/n] <span style="color:red;">Y</span><br /> - Dropping test database...<br /> ... Success!<br /> - Removing privileges on test database...<br /> ... Success!<br /><br /> Reloading the privilege tables will ensure that all changes made so far<br /> will take effect immediately.<br /><br /> Reload privilege tables now? [Y/n] <span style="color:red;">Y</span><br /> ... Success!<br /><br /> Cleaning up...<br /><br /> All done! If you've completed all of the above steps, your MariaDB<br /> installation should now be secure.<br /><br /> Thanks for using MariaDB!<br /> root@slackware:~#<br /></code></td> </tr></table><p>4- Test mariaDB:</p> <table><tr><td><code>root@slackware:~# <span style="color:red;">mysql -u root -p</span><br /> Enter password: <span style="color:red;">Enter MariaDB password. It's invisible.</span><br /> Welcome to the MariaDB monitor. Commands end with ; or \g.<br /> Your MariaDB connection id is 9<br /> Server version: 5.5.32-MariaDB MariaDB Server<br /><br /> Copyright (c) 2000, 2013, Oracle, Monty Program Ab and others.<br /><br /> Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.<br /><br /> MariaDB [(none)]&gt;<br /></code></td> </tr></table><p>5- Create a new database:</p> <table><tr><td><code>MariaDB [(none)]&gt; <span style="color:red;">create database basicconfdb;</span><br /> Query OK, 1 row affected (0.00 sec)<br /><br /> MariaDB [(none)]&gt;quit;<br /></code></td> </tr></table><p>6- That's all.</p> </div></div></div><!-- google_ad_section_end --><div class="field field-name-field-tags field-type-taxonomy-term-reference field-label-above"><div class="field-label">Tags:&nbsp;</div><div class="field-items"><div class="field-item even" rel="dc:subject"><a href="/tags/mariadb" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">MariaDB</a></div><div class="field-item odd" rel="dc:subject"><a href="/taxonomy/term/7" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">linux tutorials</a></div></div></div> Tue, 07 Jan 2014 07:55:09 +0000 jinlusuh 315 at