This article describes how to connect a PHP script to a MySQL database.
MySQL
How to install LAMP (Linux, Apache, MySql-Maria, PHP) on Debian 11
This article describes How to install LAMP (Linux, Apache, MySql-Maria, PHP) on Debian 11. The first step is to install a Devian server.
ERROR 1253 (42000) at line 31: COLLATION ‘utf8mb4_unicode_ci’ is not valid for CHARACTER SET ‘utf8’
Mysql import error was shown when exporting a database from cPanel to a local server. During the migration of a web application, I got the below error while restoring a database on another server. The collation id may differ based on the MySQL version. Error message: The MySQL server running on the new server is … Read more
Location of MySQL – MariaDB configuration file on Debian 11 and Tuning It
Locate mariadb config files: Tweaking mariadb To optimize the server, edit 50-server.cnf Run the tuner Create a simple bash script to check if MySQL is running and if not to restart it. Run this script every 5 minutes using a cron job like this one:
Install MySQL, Nginx and Zabbix on Debian 11
At first, let’s update the packages: Next, download MySQL from the offical page or use wget command: Get the repo package When you attempt to install the package, it will ask you what product and version you want to install. Here you can select The MySQL version, Tools, Connectors (like MySQL Workbench), and preview packages. … Read more
Lamp script for CentOS 8
Here is a simple lamp install script for CentOS 8. Check the installation Insert the PHP code below and save the file. [/bash] Then head out to your browser, and type the URL below. Remember to replace the server IP address with your server’s actual IP address. http://server-ip-address/info.php
Import a large sql dump file to a MySQL database from command line
How to import a very large SQL dump file (6 Gb) to a MySQL database using windows command line. If you are using linux it is the same. The process is the following: Open a command prompt (or shell in Linux) with administrative privilleges Connect to a mysql instance using command line: # mysql -h … Read more
Mariadb default logs location & –log-error
I am using mariadb and I to investigate some issue I wanted to check the logs. To my surprise, log file is not generated for mariadb. I suspect this cannot be the case so I am doubting my search skills. MariaDB [(none)]> show variables like 'log_error' -> ; +—————+——-+ | Variable_name | Value | +—————+——-+ … Read more
Determine which Mysql configuration file is being used
Here is how to quickly Determine which Mysql configuration file is being used $ which mysqld /usr/sbin/mysqld $ /usr/sbin/mysqld –verbose –help | grep -A 1 "Default options" Default options are read from the following files in the given order: /etc/mysql/my.cnf ~/.my.cnf /usr/etc/my.cnf
MySQL shows warning: Using unique option is deprecated and will be removed in a future release
Error when exporting a dump in plesk databases (See:https://docs.plesk.com/en-US/onyx/reseller-guide/website-management/website-databases/exporting-and-importing-database-dumps.69538/): Warning: Using unique option prefix database instead of databases is deprecated and will be removed in a future release. Please use the full name instead. Cause key_buffer and myisam-recover are deprecated in Mysql 5.5. myisam-recover option is renamed as of MySQL 5.5.3 to myisam-recover-options . Resolution … Read more