Check out this article: https://www.digitalocean.com/community/tutorials/how-to-install-mysql-on-ubuntu-20-04
Category: MySQL
-
Install MySQL on Mac with Homebrew
Uninstall first if needed
brew remove mysql brew cleanup launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist rm ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist sudo rm -rf /usr/local/var/mysql
Install
brew install mysql mysqld --initialize --explicit_defaults_for_timestamp mysql.server start # no sudo!
Another good guide here
Useful commands
brew services start mysql brew services stop mysql brew services restart mysql
-
Install Nginx, PHP, MySQL on Mac
A very good guide here
-
Get last inserted row ID from WordPress database using
$lastid = $wpdb->insert_id;
added after the insert query
Source: https://stackoverflow.com/questions/1576018/how-to-get-last-inserted-row-id-from-wordpress-database
-
Fix XAMPP MySQL server shutdown unexpectedly
IMPORTANT: do NOT delete
ibdata1
file. You could destroy all your databases.Instead, first try using the MySQL backup folder which is included with XAMPP. So do next steps:
- Rename folder
mysql/data
tomysql/data_old
- Make a copy of
mysql/backup
folder and name it asmysql/data
- Copy all your database folders from
mysql/data_old
intomysql/data
(exceptmysql
,performance_schema
, andphpmyadmin
folders) - Copy
mysql/data_old/ibdata1
file intomysql/data
folder - Start MySQL from XAMPP control panel
Source: https://stackoverflow.com/questions/18022809/how-to-solve-error-mysql-shutdown-unexpectedly
- Rename folder