MySQL Database Tutorials

Comprehensive MySQL Tutorials with examples along with fine tuning tips and tricks for your MySQL Database Server
  Title / Author Replies
MySQL is a matured RDMBS with numerous built-in functions in various categories like strings, numbers, conditional operators, etc. Some of these functions have really good potential to help out developers, but it seems these functions are not known to the majority of developers, and therefore are...
Most of the programmers are provided username/password pair which is used in their relevant programs to work with even in a development environment, which is replaced by deployment team when making the code live. So, generally a lot of programmers have no idea how users are created or how...
String manipulation & substring extraction are an important part of any programming language, so it to RDBMS systems like MySQL where it helps to off-load processing at program end by processing string as required at the server end, also sometimes it turns double efficient as the database...
A join is used to retrieve needed data based on the relationships that are shared between them. Creating Left Join A left join returns the rows from the left hand side (primary table, as I like to call it) table, and the corresponding matches from the right hand side table (the joined table),...
GROUP_CONCAT function is one MySQL's lesser known functions, which has the ability to ease programmers' work in certain situations. As the name of the function might suggest the function is used to group and output the fields delimited by a delimiting character specified by the user which default...
MySQL -?, --help, -IDisplay help. --auto-rehashEnable automatic rehashing. Disable with --disable-auto-rehash. -A, --no-auto-rehashNo automatic rehashing. WARNING: options deprecated; use --disable-auto-rehash instead. -B, --batch Don't use history file. Disable interactive behavior. ...
A very interesting and useful capability of MySQL is to incorporate Regular Expressions (regex) in SQL queries. The regular expression support in MySQL is extensive. Let's take a look at using Regular Expressions in queries and the supported metacharacters. Using Regular Expressions in queries ...
Sometimes we require to copy an existing MySQL table to another table, usually we get the SQL dump and execute it to create the new table, but we have a shortcut to do that. For instance if we need to make a copy of go4expert_users to a table named go4expert_users_new we need to execute the...
I just happen to make my life worse when I forgot my MySQL password on my Vista PC. I tried Googling out for forgot password for Windows Vista but happen to find everything from XP to Linux but not Vista and after going through each of them including the Linux one's as well I happen to reset the...
A lot of developers would choose PHP than any other programming languages. Why? Because PHP is commonly said to be faster and more efficient for complex programming tasks and trying out new ideas, and is considered by many to be more stable and less resource-intensive as well. It is a very powerful...
TEXT TYPES CHAR( ) A fixed section from 0 to 255 characters long. VARCHAR( ) A variable section from 0 to 255 characters long. TINYTEXT A string with a maximum length of 255 characters. TEXT A string with a maximum length of 65535 characters. BLOB A string with a maximum length of...
If you're using MySQL, there are some easy things you can do to secure your systems and significantly reduce the risk of unauthorized access to your sensitive data. The most valuable asset for technology-based organizations is usually the customer or product information in their databases. And...
Relational Database Design is one of the most powerful ways to ensure data integrity and a great way to kick-off any project. Very often the first thing developers do when starting a new project, or stub-project, is to design the database. This way the structure of the application is already in...
Many times we need to update a record but we might not know whether such a record exists or not. In traditional programming we usually check whether the record exists or not, then perfrom the appropriate query according to the result of the previous query. A very good example of such situatuion is...
Many of the more mature databases like MySQL, Oracle, PostgreSQL, etc. support the concept of prepared statements. Many languages or their database abstraction classes/modules support or sometimes need you to prepare the queries before they are executed, also some modules require that you prepare...
Recent versions of MySQL have implemented support for foreign keys through the InnoDB table engine. Let's see how it works. Referential integrity is an important concept in database design. The term refers to a state when all the references in a database are valid and no invalid links exist...
Data in MySQL is stored in files (or memory) using a variety of different techniques. Each of these techniques employs different storage mechanisms, indexing facilities, locking levels and ultimately provides a range of different functions and capabilities. By choosing a different technique you can...
Introduction A MySQL database abstraction class, which makes database handling easier and object-oriented. The class: class DBI { var $server; var $user;
Introduction Sometimes we need to get a formatted date while getting the date from a MySQL database using a SQL query. Fortunately, MySQL has an in-built function called DATE_FORMAT which will help us to acheive the same. DATE_FORMAT(date,format) What is what?? Here are the format...