Exercises, examples and other material relating to training module S153. This topic is presented on public courses
MySQL is a service that's provided by host computers, similar to the way they provide services such as ftp. Such services aren't there and running when you take a new computer out of the box; you need to obtain the latest version of the server software, set up configuration information so that it's suitable for your particular requirements, and actually run the service.
|Articles and tips on this subject||updated|
|4487||Starting MySQL. ERROR! The server quit without updating PID file - how we fixed it.|
Our MySQL databases are backed up frequently, and I've arranged for our server to email me in the event of a failure. From our /bin/bash script which is run by crontab:
/usr/local/mysql/bin/mysqldump -ufgw -psummat -h127.0.0.1 fgw > /home/backups/$HOUR/fgw.sql
if [ "$?" -eq ...
|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 ...
|1731||Apache httpd, MySQL, PHP - installation procedure|
If you're installing LAMP (Linux, Apache, MySQL, PHP), what do you do and in which order? Here's a summary of the procedure we followed on todays Apache httpd deployment course - in this case running (tailored) for a single company audience, and tailored for specfic needs.
(I've documented this and ...
|2458||Cant connect to local MySQL server through socket /tmp/mysql.sock|
Q Have you ever had the error message Can't connect to local MySQL server through socket '/tmp/mysql.sock' from your PHP program. It's one that I see quite often, but it doesn't seem all that well documented ... so what's the cause, and the cure?
A The error message seems to occur if you delete your ...
|2445||Securing MySQL on a production server|
There's a conumdrum for the authors / distributors of any open source server software that's likely to be used in a productions environment - should they send it out so that it's quick and easy to try but needs securing, or so that it's well secured but therefore calls for a bit more effort when you ...
|2444||Potted MySQL installation|
Putting MySQL onto a machine that may previously have had an install ... here's a summary of the commands we used yesterday. It's a useful checklist (reminders to get rid of old config files that could cause a new install to start with old data, for example) but you 'll need to adopt / adapt individual ...
|2426||Which version of MySQL am I running?|
Oh be careful - that is a VERY dangerous question. Do you mean "what version is my MySQL server" or "what version of the mysql client program am I running?" I'll show you how to find answers to both questions.
What version is my MySQL server?
Use the select command, and run the version function within ...
|2209||Monitoring and Tuning your MySQL installation|
How much memory does MySQL occupy? Is it efficient / does it need more memory? Can I tune it?
All good questions ... and to make the most of any answers, there's something you'll need to know first about the structure of MySQL. It runs as a series of daemon processes / services, each of which has ...
|2085||MySQL - licensing issues, even with using the name|
MySQL is a really good database and it's been available for a very long time under an open source license - indeed this piece of text will be stored in a MySQL database when I've added it to our web site using the Movable Type software , and pulled back from there using both Movable type software (here), ...
|907||Browser -> httpd -> Tomcat -> MySQL. Restarting.|
I've just completed a course covering the installation and configuration of Apache httpd, Apache Tomcat and MySQL. Complete with a demonstration that has the newly installed systems visited from various browsers, talking to httpd, which talks on to Tomcat, which talks on in turn to MySQL. The MySQL ...
|1935||Summary of MySQL installation on a Linux system|
The critical steps of deleting an old copy of MySQL, and installing and starting up a nice new clean one!
(the numbers are my "history number" - I did a lot of ls-ing and vi-ing in between!)
1001 cd /usr/local
1004 rm -rf mysql-5.1.24-rc-linux-i686-icc-glibc23/
1006 rm mysql
1009 tar xzf /home/trainee/bristol/mysql-5.1.24-rc-linux-i686-icc-glibc23.tar.gz ...
|1771||More HowTo diagrams - MySQL, Tomcat and Java|
Here are some more diagrams "off the wall" from last week - showing "howto" and "whatis" information for Tomcat, Java and MySQL
Some Tomcat and Java Fundamentals
On the right of the board ... the main java programs ...
• the Java compiler is called javac
• the Java Virtual machins is in a ...
|1689||Some sideways thoughts on the news|
"Women to be more equal than men" said the headline on the newspaper sitting on the desk where I was working yesterday - and it struck me that we're more and more in George Orwell's world of Animal Farm and 1984, with some crazy doublespeak and perhaps the thought police out to ensure that everything ...
|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. ...
|1123||mysqldump and mysqlrestore|
It is vital that you back up your data ... and if you hold your data in a MySQL database, then the mysqldump utility will do the job admirably for you.
It is equally vital that you can restore the data from backup if (heaven forbid) you need to do so ... and yet there is not a mysqlrestore utility.
|1095||Apache httpd , browser, MySQL and MySQL client downloads|
If you download a copy of the Apache httpd web server, does it come bundled with a browser as well?
No - it doesn't. Although you'll access your web server through a browser most of the time (or rather your USERS will) it would be pretty odd to download both pieces of software together.
and yet ....
|515||MySQL - an FAQ|
We're becoming a serious MySQL resource, with many technical articles, examples, forum posts and blog entries answering those difficult-to-resolve issues you may have come across. You might like to bookmark (or link to) this page.
Eleven recent articles on MySQL ...
Flashbulb moments - facts that ...
|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
|591||Key facts - SQL and MySQL|
Some quick ways to remember your SQL; here are some "flashbulb moments" for newcomers and occasional users of MySQL and other SQL databases.
A database daemon is a process that looks after a number of DATABASES each of which comprises a number of TABLES each of which comprises data arranges in ROWS ...
|489||Which MySQL server am I using?|
On occasions during MySQL courses, our trainees find that data they thought they had uploaded isn't available to them, or that they're denied login when they feel they've entered the correct user name and password. There are two reasons this can happen:
a) MySQL logins depend on user name, password, ...
Some modules are available for download
as a sample of our material or under an Open Training Notes License
for free download from http://www.training-notes.co.uk
A potted installation procedure.
For use on our training systems.
Installing MySQL onto your laptop.
Install the Perl DBD and DBI modules.
Testing your Installation.
Running the MySQL daemon.
Programs for the user and administrator.
Using the mysqladmin program.
Using the mysql client program.
Managing user accounts and privileges.
Adding an account.
Adding Additional privileges on a per-database basis.
Additional access on a per-host, per table and per-column basis.
Disk structure of data held in a MySQL database.
The data directory.
Setting up security and levels of access.
O/S level and web-level access.
Log in access to MySQL.
Four levels of access within MySQL.
Backing up your database.
Dumping by table.
Accessing mysqld from around your network.
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. Also
available is the Opentalk
Forum for discussion of technical questions.