Exercises, examples and other material relating to training module S161. This topic is presented on public course MySQL
MySQL provides facilities to control the access to data which it holds. This is necessary to prevent unauthorised alteration or viewing of information, and also to ensure that applications are robustly written to maintain data integrity.
Related technical and longer articlesCopying databases and tables in MySQL
|Articles and tips on this subject||updated|
|4493||Forgotten / lost MySQL root password|
OK - I admit it. A very silly thing to do. I had lost / forgotten my MySQL password, and needed to do some admin work.
1. Log in to server as root
2. Stop the database server
/etc/init.d mysql.server stop
3. Start the database server without password check
|4491||Web Server Admin - some of those things that happen, and solutions|
The techincal "Buck" with our web sites stops with me - and any little admin issues that come up while I'm away on holiday need to be sorted - and of course Murphy's law states that a problem will always happen at the worst possible time. And so it's been with a couple of never-before issues that have ...
|4481||Extracting data from backups to restore selected rows from MySQL tables|
We take backups from our live server, using mysqldump for the databases, and tar / gzip for most of the file systems. And when we had a server failure which meant a reload (and a new underlying OS too), we were able to be back online in a couple of hours, with minimal data loss.
But our backups are ...
|4406||Fixing damaged MySQL tables - Error 1712 and Error 2013|
ERROR 1712 (HY000): Index smf_messages is corrupted
ERROR 2013 (HY000): Lost connection to MySQL server during queryA
mysqldump: Error 2013: Lost connection to MySQL server during query when dumping table `smf_messages` at row: 135457
Oops ... I don't know what to say ...
"Don't Panic" in the words ...
|4390||Checking MySQL database backups have worked (not failed)|
We do a regular backup of of MySQL databases within our server to keep recent local data "checkpoint" sets there - they allow us to look back at what the data used to be if we have a naughty user, and in the worst case scenario of a software problem / database corruption we can roll back. However we've ...
|3270||SQL - Data v Metadata, and the various stages of data selection|
MySQL is a system for managing data ... so it's natural for it to manage its own configuration data too in the same way. However, there are a few elements which have to be kept outside those internal tables - such as the data about which port number the daemon is to listen on, and the directory name ...
|2647||Removing duplicates from a MySQL table|
Surely there's got to be an easy way to remove duplicate records from a MySQL table? With a well designed table that has a unique primary key, you can simply get rid of a few duplicates, but if there are a lot of 'em, it's time consuming. You could write some sort of complex delete based on a select. ...
|2263||Mysqldump fails as a cron job - a work around|
Here's a curiosity ... running a mysqldump as a crontab job, nothing happens on one of our servers. Now I HAVE included the full path to the executable file in my crontab line, and I have redirected the output to a full path ... so something else is tripping it up.
What do I do? An Internet search ...
|2204||Images in a database? How big is a database? (MySQL)|
The discussion came up yesterday as to whether images should be stored in plain files or in a database, with one of my delegates saying that he had been strongly advised against a database.
That advise is typically going to be correct for a handful of images ... but when you get on to thousands in a ...
|1131||MySQL - Password security (authentication protocol)|
Ever had this message?
bash> mysql -h www.weekendinwiltshire.co.uk -u weekend -p
Enter password: ******
Client does not support authentication protocol requested by server; consider upgrading MySQL client
The MySQL login password / security model changed between MySQL version 4.0 and version 4.1. ...
|947||What is an SQL injection attack?|
An SQL injection attack is where a user of your form enters a piece of SQL code into it, and wraps it in special characters in such a way that the data entered doesn't get used for the purpose you had intended - it gets used to corrupt or destroy your database.
For example, if your form returns to $_REQUEST[message] ...
|535||MySQL permissions and privileges|
In MySQL, users log in with a user name and password (the login also depends on their client computer's name or IP address which can be restricted). Each user account has a set of permissions which are set up to offer:
a) Global privileges over all databases managed by the current MySQL instance PLUS
|647||Checking for MySQL errors|
It's worrying when a web site that's been rock solid starts giving intermittent problems - and even more worrying when those intermittent problems just fade away and you're left unsure as to what was the cause of them. I'm afraid I'm the sort who wonders if and when the issue will return.
And so it ...
Some modules are available for download
as a sample of our material or under an Open Training Notes License
for free download from [here]
Topics covered in this module
Introduction to the MySQL security model.
MySQL login accounts.
A straightforward example.
A private database for each of a group of users.
Operating system security.
Ownership of the mysqld process.
File ownerships and permissions.
MySQL configuration files, command line options.
Order of file selection.
Command line options.
Running multiple servers on one system.
Basic first setup - example.
If you are looking for a complete course and not just a information on a single subject, visit our Listing and schedule
Well House Consultants specialise in training courses in
. We run
throughout the UK (and beyond for longer courses), and
at our training centre in Melksham, Wiltshire, England.
It's surprisingly cost effective to come on our public courses -
even if you live in a different
country or continent to us
We have a technical library of over 700 books on the subjects on which we teach.
These books are available for reference at our training centre.