Category Archives: MySQL

MySQL

MySQL – New Database > New User

I’m trying to get a little more granular on DB security in Linux and to that end used the MariaDB root user for all LAMP installations is probably not the brightest idea. I’ll try to commit this to memory but until then I’ll follow these steps to create a new database and then a new user with full access to that DB thereby isolating the databases from each other so one breach doesn’t take down the system.

mysql -u root -p

CREATE DATABASE newDatabase;

GRANT ALL PRIVILEGES ON newDatabase.* TO 'newUser'@'localhost' IDENTIFIED BY 'newPassword' WITH GRANT OPTION;

FLUSH PRIVILEGES;

MySQL

Starting MySQL in Fedora Core 16

We’re going through a hardware upgrade at work and we were given the chance to take home our old computer when they swapped it out with a new one.  Yeah, needless to say I jumped at the chance to have my old 2.2Ghz with 4Gb of RAM dev box as my new Linux server.  I installed FC 16 and had to monkey around with MySQL to install it, eventually uninstalling the default instance and downloading it direct from MySQL.  This first gave me problems installing MediaTomb with this cryptic error:

file /usr/share/mysql/charsets/README from install of mysql-libs-5.5.18-1.fc16.i686 conflicts with file from package MySQL-server-5.5.18-1.linux2.6.i386

So by removing the default and installing the generic I managed to cause some damage.  I went into webmin and uninstalled the following:

MySQL-client 5.5.18-1.linux2.6 Applications/Databases MySQL – Client
MySQL-devel 5.5.18-1.linux2.6 Applications/Databases MySQL – Development header files and libraries
MySQL-server 5.5.18-1.linux2.6 Applications/Databases MySQL: a very fast and reliable SQL database server
MySQL-shared 5.5.18-1.linux2.6 Applications/Databases MySQL – Shared libraries

I then installed MySQL from yum.  It loaded fine but I couldn’t for the life me find out how to start it, the standard /etc/rc.d/init.d/mysqld was not to be found.

I found this in a post and it worked (logged in as root) so I figured I’d better document it so I don’t forget:

systemctl start mysqld.service