2. I am Jisse Reitsma
Developer
Enterpreneur
Founder of Yireo
Joomla! & Magento
Extensions & development
Documentation & blogs
Joomla! templates-book (NL)
Presentation “phpMyAdmin for beginners” - http://slideshare.net/yireo
Jisse Reitsma (jisse@yireo.com) - Twitter @yireo
3. You are a ...
Joomla! site-owner?
Joomla! builder?
Joomla! developer?
Presentation “phpMyAdmin for beginners” - http://slideshare.net/yireo
Jisse Reitsma (jisse@yireo.com) - Twitter @yireo
4. My presentation
Part I - MySQL
Part II - phpMyAdmin
Part III - Advanced
Presentation online: http://slideshare.net/yireo
Tweets: @yireo
Presentation “phpMyAdmin for beginners” - http://slideshare.net/yireo
Jisse Reitsma (jisse@yireo.com) - Twitter @yireo
6. Introduction to MySQL
Part of a stack
Client/server architecture
What is SQL?
Presentation “phpMyAdmin for beginners” - http://slideshare.net/yireo
Jisse Reitsma (jisse@yireo.com) - Twitter @yireo
7. Stack
Joomla! is based on PHP, which runs on a webserver with PHPsupport (like Apache), and data are stored in MySQL.
Examples of webserver “stacks”
Linux + Apache + Mysql + PHP = LAMP
MacOS + Apache + Mysql + PHP = MAMP
Windows + Apache + Mysql + PHP = WAMP
Windows + IIS + Mysql + PHP = WIMP
Presentation “phpMyAdmin for beginners” - http://slideshare.net/yireo
Jisse Reitsma (jisse@yireo.com) - Twitter @yireo
8. Introduction to MySQL
Part of a stack
Client/server architecture
What is SQL?
Presentation “phpMyAdmin for beginners” - http://slideshare.net/yireo
Jisse Reitsma (jisse@yireo.com) - Twitter @yireo
9. MySQL server
MySQL on the same server as the website
localhost
On a different server but with the same hoster
mysql12345.hoster.local
On a different server with a different hoster
TCP-port 3306 opened in firewall
Security becomes a major issue
Presentation “phpMyAdmin for beginners” - http://slideshare.net/yireo
Jisse Reitsma (jisse@yireo.com) - Twitter @yireo
11. Introduction to MySQL
Part of a stack
Client/server architecture
What is SQL?
Structured Query Language
A way to talk with a relational database
Presentation “phpMyAdmin for beginners” - http://slideshare.net/yireo
Jisse Reitsma (jisse@yireo.com) - Twitter @yireo
12. Structured Query Language
A common language to talk with different databases:
SELECT field FROM table
DELETE FROM table WHERE id = 2
INSERT INTO table SET id = 2, value = “example”
... but unfortunately there are still a lot of different SQL dialects
Presentation “phpMyAdmin for beginners” - http://slideshare.net/yireo
Jisse Reitsma (jisse@yireo.com) - Twitter @yireo
14. Relational database
Store data in multiple database-tabels that relate to each other
Normalisation
“Technique, used in the process of designing a database-structure, with the
purpose to avoid storing the same data multiple times”
Presentation “phpMyAdmin for beginners” - http://slideshare.net/yireo
Jisse Reitsma (jisse@yireo.com) - Twitter @yireo
15. Example 1: Joomla! users
jos_users
List of users
jos_usergroups
List of usergroups
jos_user_usergroup_map
Connection between users and usergroups
Presentation “phpMyAdmin for beginners” - http://slideshare.net/yireo
Jisse Reitsma (jisse@yireo.com) - Twitter @yireo
16. Example 2: Joomla! articles
jos_content
List of articles (with a reference to catid & asset_id)
jos_categories
List of categories
jos_assets
List of authorizations
Presentation “phpMyAdmin for beginners” - http://slideshare.net/yireo
Jisse Reitsma (jisse@yireo.com) - Twitter @yireo
19. Login to phpMyAdmin
Direct weblink
Control panel
CPanel, Plesk, DirectAdmin
custom panel
Presentation “phpMyAdmin for beginners” - http://slideshare.net/yireo
Jisse Reitsma (jisse@yireo.com) - Twitter @yireo
20. Creating a database
Create an user with corresponding database
Check upon the character collation
utf8_unicode_ci / utf8_general_ci
Presentation “phpMyAdmin for beginners” - http://slideshare.net/yireo
Jisse Reitsma (jisse@yireo.com) - Twitter @yireo
32. Export
Which database tables?
Single database-table?
Multiple database-table?
All database-tables? (so: the entire database)
Which data?
Table-structure and/or table-data
... or use “Akeeba Backup” (akeebabackup.com)
Presentation “phpMyAdmin for beginners” - http://slideshare.net/yireo
Jisse Reitsma (jisse@yireo.com) - Twitter @yireo
34. Database table prefix
Database table prefix
Adjustable during Joomla! installation
Make hacks more difficult (SQL-injection)
Recommendations
Do not choose “jos_”
Do not choose “verylongstring_”. MySQL limits table-name to 64 characters
Presentation “phpMyAdmin for beginners” - http://slideshare.net/yireo
Jisse Reitsma (jisse@yireo.com) - Twitter @yireo
35. User ID 42
Default “admin” user had ID 42 (Joomla! 2.5 and older)
Make hacks easier (SQL-injection)
Procedure to adjust
Create a new Super User and login as that user
Degrade the old Super User to administrator
Remove that administrator
Update current Super User with old settings
... or use “Akeeba AdminTools” (akeebabackup.com)
Presentation “phpMyAdmin for beginners” - http://slideshare.net/yireo
Jisse Reitsma (jisse@yireo.com) - Twitter @yireo
36. Cleanup of database-tables
TRUNCATE `jos_content`;
Be very careful with this
Make sure to have a backup
Make manual checks with other tables
Presentation “phpMyAdmin for beginners” - http://slideshare.net/yireo
Jisse Reitsma (jisse@yireo.com) - Twitter @yireo
37. JOINs
LEFT JOIN
RIGHT JOIN
INNER JOIN
OUTER JOIN
Presentation “phpMyAdmin for beginners” - http://slideshare.net/yireo
Jisse Reitsma (jisse@yireo.com) - Twitter @yireo
39. UTF-8 & collations
UTF-8 = Default character set for Joomla!
Support for Western languages, Arab, Sanskrit, Klingon
Collations = Interpretation of characterset for storage
utf8_general_ci (standard)
utf8_unicode_ci (recommended)
utf8_polish_ci
latin1 (do not use)
Presentation “phpMyAdmin for beginners” - http://slideshare.net/yireo
Jisse Reitsma (jisse@yireo.com) - Twitter @yireo
40. Wrong collation
If a Joomla! database does not use UTF-8, make sure it does
(for every database, table and field)
Set Joomla! site offline
Export the datase to a SQL-file
Change all occurances of “charset=latin1 “ to “charset=utf8”
Import the SQL-file
... or use “Phoca Changing Collation Tool” (phoca.cz)
Presentation “phpMyAdmin for beginners” - http://slideshare.net/yireo
Jisse Reitsma (jisse@yireo.com) - Twitter @yireo
41. MyISAM & InnoDB
MyISAM Storage Engine
Default in most hosting environments
InnoDB Storage Engine
More advanced; More tuning options
But not necessary for running Joomla!
Presentation “phpMyAdmin for beginners” - http://slideshare.net/yireo
Jisse Reitsma (jisse@yireo.com) - Twitter @yireo