Author: Alex

PHP not displaying emoji from MySQL/MariaDB database (SOLVED)

When retrieving rows from a MySQL (MariaDB) database, you may encounter a situation where all the text is displayed correctly, but question marks are displayed instead of emoji. The most likely problem is an incorrectly used encoding when executing queries against the MySQL (MariaDB) DBMS. There are two ways to fix this situation. 1. Select utf8mb4_unicode_ci encoding when creating database...

What is the difference between utf8_general_ci, utf8_unicode_ci, utf8mb4_general_ci, utf8mb4_unicode_ci collations. Which collation, character set and encoding to choose for MySQL database

As of MySQL 5.5.3 you must use utf8mb4 and not utf8. Both of these groups refer to UTF-8 encoding, but the older utf8 has MySQL-specific restrictions that prevent characters above 0xFFFD from being used. Thus, neither utf8_general_ci nor utf8_unicode_ci need to be used anymore. As for the new encoding versions utf8mb4_general_ci and utf8mb4_unicode_ci. That is unicode preferred over general. The...

Error “ERROR 1142 (42000)”: command denied to user for table in MySQL / MariaDB (SOLVED)

Error number 1142 (42000) occurs when the user does not have enough privileges on the table or database to execute the query. An example of an error when executing a query with a SELECT statement: SELECT * FROM TestDB.TestTABLE; The request failed with an error: ERROR 1142 (42000): SELECT command denied to user 'mial'@'localhost' for table `TestDB`.`TestTABLE` An example of...

Error “ERROR 1143 (42000)”: command denied to user for column in table in MySQL (MariaDB) (SOLVED)

How to fix “ERROR 1143 (42000)” in MySQL (MariaDB) Error number 1143 (42000) occurs when a user has privileges on some columns of a table, but he tries to exercise his privileges on those columns for which he does not have permissions. If the user tries to perform actions for which he does not have privileges on any column in...

How to allow a MySQL (MariaDB) user to create new users and grant privileges to manage databases and their contents to other users

By default, the right (privilege) to create new users, as well as grant them rights to databases, is granted only to root. The root user can do all kinds of operations on databases and users. If you want to grant some administrative privileges to another user, then you can do so. How to create a MySQL (MariaDB) administrative user You...

Why is MySQL (MariaDB) asking for a password even when it is specified with the “-p” option (SOLVED)

If you are trying to connect to the MySQL (MariaDB) server on the command line, then you may have encountered the problem that the MySQL (MariaDB) client does not see the password. For example, when connecting to MariaDB using the command (where “USER” is the actual username and “PASSWORD” is the actual password): mariadb -u USER -p PASSWORD Instead of...

Why “mysql -h” doesn’t show help. Error “option ‘-h’ requires an argument” (SOLVED)

Perhaps the most popular command line option, regardless of the utility used, is the “-h” option. For most command-line programs, the “-h” option displays help on how to use the program. But if you try to get help for MySQL like this: mysql -h Then instead of the expected list of options and their values, you will get an error:...

How to create a new MySQL (MariaDB) user and configure its status and privileges

This note will show how to create a new MySQL (MariaDB) user, as well as configure its privileges (permissions) at the DBMS level as a whole, at the level of a particular database, and even at the level of individual tables and columns. Why create a new MySQL or MariaDB user Using root to perform Data Management Language (DML) operations...

How to allow a user to access only certain columns in MySQL (MariaDB)

Table of contents 1. How to set permissions on individual columns in MySQL (MariaDB) 2. How to allow the user to add entries to a column 3. How to allow the user to view entries in a column 4. How to allow the user to update records in a column 5. How to allow the user to create a foreign...

How to allow a user to access only certain tables in MySQL (MariaDB)

Table of contents 1. How to set permissions on individual tables in MySQL (MariaDB) 2. How to allow a user to create a specific table in a database 3. How to allow a user to delete a specific table in a database 4. How to allow a user to delete records in a table 5. How to allow a user...
Loading...
X