Practical solutions

MySQL Howtos How-To Guides

Solve the problem. Keep building. Collection of MySQL how-to articles

Find the answer you need

Browse practical solutions, grouped by the task you're working on.

__COUNT__ entries on this page

How to Pivot Table in MySQLLearn fixed and dynamic ways to pivot rows into columns in MySQL. How to Calculate Percentage in MySQLLearn how to calculate a row's share of a total, a ratio between two columns, and grouped shares in MySQL. How to Group the Datetime Column by Date Only in MySQLGroup MySQL DATETIME values by calendar date and count attendance rows with DATE() and GROUP BY. How to Export MySQL Database Using MysqldumpWe will learn about how to export MySQL database using mysqldump command-line utility. We will also learn how to export tables from a particular database. How to Show the Current Database in MySQLCheck the database selected for your MySQL session with SELECT DATABASE(), MySQL Workbench, or the interactive mysql client. Learn what NULL means and how to select a database. Difference Between VARCHAR and TEXT in MySQLCompare MySQL VARCHAR and TEXT by expected values, declared length, storage considerations, and query needs, then choose a suitable column type. How to Get the Size of MySQL DatabaseThis tutorial demonstrates how to find the size of a MySQL database. How to Create New Database in MySQL WorkbenchThis tutorial guides you about how can you create a new database using GUI options and SQL query in MySQL Workbench. How to Search Occurrences of String in MySQL DatabaseThis tutorial guides you on how you can search a complete database to find the occurrences of a pattern or string in MySQL Workbench and phpMyAdmin. How to Update Multiple Tables With One Query in MySQLThis article introduces how to update multiple tables with one query in MySQL. How to Sort MySQL Data in Alphabetical OrderLearn how to sort MySQL rows by a text column in ascending or descending alphabetical order. How to Check if String Contains Certain Data in MySQLThis tutorial demonstrates how to check whether a string contains a certain data or substring in a MySQL table. How to Split String in MySQLThis tutorial demonstrates how to split a string in a MySQL database effectively. Learn various methods, including the SUBSTRING_INDEX function and JSON functions, to manipulate strings and extract valuable data. Enhance your MySQL skills with practical examples and clear explanations, making string handling straightforward and efficient. How to Connect to a MySQL Database Using JDBCBuild a MySQL JDBC connection URL and use Java with MySQL Connector/J to connect, check the connection, and close resources. How to Access MySQL Command Line With XAMPPConnect to XAMPP's MySQL-compatible server from the command line, create a target database, and import an SQL file into it. Check Whether a Row Exists in MySQL with EXISTS and IF()Check whether a row matches a condition in MySQL with EXISTS, then use IF() to return a readable result. How to Import Excel File Into a MySQL DatabaseLearn three ways to import Excel data into MySQL: convert it to CSV for LOAD DATA or phpMyAdmin, or convert the workbook with Sqlizer.io. How to Drop All Tables in MySQLSafely remove every base table from a MySQL database, handle foreign keys, and verify the result. How to Declare and Use Variables in MySQLLearn when to use MySQL session variables, local DECLARE variables, or system variables, with SET, SELECT ... INTO, scope rules, and tested examples. How to Truncate All Tables in MysqlIn this tutorial, learn how to truncate all tables in MySQL efficiently. We explore various methods, including dynamic SQL and Python scripts, to help you reset your database quickly. Understand the implications and best practices for truncating tables in MySQL. Transaction Log in MySQLThis tutorial explains how to access the transaction log in a MySQL database using Python. Learn different methods, including MySQL Connector, SQLAlchemy, and MySQLdb, with clear code examples and detailed explanations. Enhance your database management skills by understanding how to monitor and maintain transaction integrity effectively. How to Restart MySQL Server on WindowsThis tutorial demonstrates how to restart MySQL server on Windows using various methods including command line, MySQL Workbench, and batch files. Learn effective steps to manage your MySQL server and resolve common issues with ease. Whether you're a developer or database administrator, this guide equips you with essential knowledge for efficient MySQL management. How to View Tables in MySQL WorkbenchDiscover how to view tables in MySQL Workbench with our comprehensive guide. Learn to access table structures, query data, and export information efficiently. Whether you are a beginner or an experienced developer, this article provides essential tips and techniques to enhance your database management skills. How to MySQL Convert String to LowercaseLearn how to convert strings to lowercase in MySQL using the LOWER() function. This article covers various methods, including updating columns and performing case-insensitive searches. Discover practical examples and enhance your database management skills today!