Drupal 7 utf8mb4 support: "Please convert tables" warning... after converting tables - drupal-7

The full error I am seeing in Drush is:
Please convert all database tables to utf8mb4 prior to enabling it in settings.php. See the documentation on adding [warning]
4 byte UTF-8 support for more information. (Currently using Database 4 byte UTF-8 support Enabled, but database
tables need conversion)
I'm using the most current version of Drupal 7. I've converted all tables to utf8mb4_unicode_ci. I did so at first manually through the prompt, but then ran the updates again using phpMyAdmin on tables and fields (just to make sure, since Drush was still telling me "Please convert all database tables to utf8mb4 prior to enabling it in settings.php.") All tables are set to InnoDB.
In the my.cnf file, I've ensured that I've got
[mysqld]
innodb_large_prefix=true
innodb_file_format=barracuda
innodb_file_per_table=true
Another site on the same server has utf8mb4 support enabled, and isn't throwing the error. Both sites are using latest version of PHP 5.6.x. Drush version is 8.1.2. MySql is at the latest version of 5.5.x.
I've cleared all Drupal caches via drush cc all & restarted the MySQL server. The setup is under Ubuntu with Plesk.
Looking for thoughts on what I might have missed and why Drupal is asking me to convert tables that look like they've been converted (phpMyAdmin indeed shows the collation as utf8mb4_unicode_ci.)

Pleasse see https://www.drupal.org/forum/support/upgrading-drupal/2018-04-03/upgrade-to-758-database-utf-8-issues#comment-12968331. This message is not from a deep sql analysis but hinged on the value of the boolean variable drupal_all_databases_are_utf8mb4. This variable needs to be set to TRUE after the tables have been converted whether you do it manually or by the recommended drush script (https://www.drupal.org/project/utf8mb4_convert) which (I think) will set it for you.
-Bronius

Do you have collation and charset set in settings.php?
$databases['default']['default'] = array(
'driver' => 'mysql',
'database' => 'databasename',
'username' => 'username',
'password' => 'password',
'host' => 'localhost',
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_general_ci',
);

Related

Cakephp 4 MySQL on hosted environment

I have created a Cake solution locally and have uploaded this on my hosting provider's environment. It runs MySQL. I have full access to the respective database but of course not the MySQL main database. If I understand the situation correctly, there are multiple databases in the same environment used by other clients on different domains that I would never see.
The provider has disabled the ability to manage user rights in PHPMyAdmin. Through an admin panel I was able to create a user that is granted INSERT, UPDATE, SELECT and DELETE rights. However, with the specified datasource parameters in appl_local.php, I get the message below when I try to add a new user to the database through the users/add page. For security reasons I have marked the name of the user with asterisks in the code below.
Could it be that I have to more specifically explain on which database we are trying to execute this?
Is there a way to tell the system to always specify the database when asking for a table? For example "SELECT * FROM database_name.users" instead of just "SELECT * FROM users"? I ask this because in the message below it does not specify which database was accessed when this error was raised, only the command, the user, the table and the source code file and line number.
Or is there some schema that needs to be specified when working in a shared environment?
2021-01-07 10:39:00 Error: [PDOException] SQLSTATE[42000]: Syntax error or access violation: 1142 SELECT command denied to user '******'#'localhost' for table 'users' in /home/multigra/domains/multi-grade.nl/public_html/content/vendor/cakephp/cakephp/src/Database/Statement/MysqlStatement.php on line 39
'default' => [
'host' => 'localhost',
/*
* CakePHP will use the default DB port based on the driver selected
* MySQL on MAMP uses port 8889, MAMP users will want to uncomment
* the following line and set the port accordingly
*/
'port' => '3306',
'username' => '******',
'password' => '******',
'database' => '******',
/**
* If not using the default 'public' schema with the PostgreSQL driver
* set it here.
*/
//'schema' => 'myapp',
/**
* You can use a DSN string to set the entire configuration
*/
'url' => env('DATABASE_URL', null),
],
This was an overight from my end. I had specified the location of information a little too much in order to learn about specifying databases when data is spread over different databases. Because the production environment connects to a different database, the requested table was not found at all. The error "SELECT command denied to user '******'#'localhost' for table 'users'" did not point me in that direction. I thought it was a permission issue. Instead, the table was not found in the database and that's why the SELECT statement failed.

cant connect to database using cakephp and wampserver

I am using 64bit WampServer and cakephp 3.2 and win10. I have a new computer and need to transfer a cakephp project. There is a user Root with all privileges, with no password and database 'aptutori_apt4' n exists on phpmyadmin
The project loads if it doesnt need the database but this is what I get
error: sqlstate[hy000] [1049] unknown database 'aptutori_apt4'
I cant connect the database!
Is the host setting wrong ?
'Datasources' => [
'default' => [
'className' => 'Cake\Database\Connection',
'driver' => 'Cake\Database\Driver\Mysql',
'persistent' => false,
'host' => 'localhost',
//'port' => 'non_standard_port_number',
'username' => 'root',
'password' => '',
'database' => 'aptutori_apt4',
'encoding' => 'utf8',
'timezone' => '+11:00',
'flags' => [],
'cacheMetadata' => true,
'log' => false,
It is the same settings as my other computer on phpmyadmin and app.php. The new computer shows on phpmyadmin under database tab Server:Mysql:3308
I think your problem is that recently mariaDB became the default database in WAMPServer, so therefore mariaDB is using port 3306 (the default for almost everything MySQL) and MySQL is listening on port 3308
However, if you want to use MySQL, the simple solution would be to swap the default database in WAMPServer, and of course there is a tool for that on the WAMPManager Menus.
Right-click Wampmanager icon -> Tools -> Invert default DBMS MariaDB <-> MySQL
Now MySQL will use port 3306 and mariaDB will use port 3307.
Now your cake config should work and find the correct DBMS on port 3306 and therefore the database you have created in there.
This is the safest solution as when you move code to a live server it will almost definitely have its MySQL/mariaDB configured to use port 3306 and you wont need to change anything in your config.
Alternatively
You could put the port number that MySQL is Listening on in this param
'port' => '3308',
But you will almost definitely have to change this when the site get moved to a Live Server, and then you dev code and your live code will be different, unless you remember not to transfer this file after the first time.
Oh and remember you can reverse this change in default database, just go back to the menus and the menu you used last time should say
Right-click Wampmanager icon -> Tools -> Invert default DBMS MySQL <-> MariaDB
Do that and you are back to mariaDB using port 3306

Install TYPO3 8.7.7 with SQL Server on IIS

I tried to install TYPO3 (8.7.7) on my Webserver (IIS) and I'd like to use my SQL Server instead of MySQL.
I found lots of instructions how to make this (on typo3.org and other websites) but none of these worked for me.
I found out, that I must install two extensions before I start the installation (ADOdb & DBAL). Probably there is my fault.
Can anybody explain step by step how to install these extensions before the TYPO3 installation?
I'm using the following configuration to successfully run TYPO3 on SQL Server on my local windows machine:
'DB' => [
'Connections' => [
'Default' => [
'charset' => 'utf-8',
'dbname' => 't3',
'driver' => 'sqlsrv',
'host' => 'localhost',
'password' => 'yourPassword',
'port' => 1433,
'user' => 'sa',
],
],
],
It's a bit complicated to set up with the installer as it is not yet "clickable". What you can do is call the install script and when it's asking you to configure the database connection you go to your file system and manually add the config section above (with your connection params of course) in the LocalConfiguration.php file.
Then reload the installer - which should now recognize the configured database connection and let you go to the last step where you can import / create the base tables and data.
Note: At the moment I know of two bigger areas where SQL Server is still a problem with TYPO3 8.7 - that's workspaces and database compare. The last one means that after you have existing data in your SQL Server tables won't let you alter them via the TYPO3 database compare tool - you have to change tables manually if you need to.
Find a gist of the table create statements on https://gist.github.com/psychomieze/9570ea1f578aee7a1fbb68c3240a21c8
With 8.7, Doctrine DBAL has been integrated into the core and ADOdb & DBAL sysexts have been removed as there is no need anymore.
Take a look at the documentation of Doctrine DBAL http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html and it should fit perfectly to the configuration of the DB in `LocalConfiguration.php``
'DB' => [
'Connections' => [
'Default' => [
'charset' => 'utf8',
'dbname' => 'typo3',
'driver' => 'mysqli',
'host' => 'mysql',
'password' => 'dev',
'port' => 3306,
'user' => 'root',
],
],
],
Now my Typo3 is working.
I solved my problem a little bit complicated.
I made a test environment and installed Typo3 with MySQL.
Then I copied the database with the "Microsoft SQL Server Migration Assistant 7.6 for MySQL"
(https://www.microsoft.com/en-us/download/details.aspx?id=54257) to my main environment.
After that I copied all the created folders (typo3conf, typo3temp etc.) to my main environment
and edited the databaseconnection in the LocalConfiguration.php file like Georg Ringer proposed.
When I am installing Typo3 and MSSQL next time I will do it like susi proposed.
Thanks for your help.

Use Cakephp 2.4.4 with oracle?

Can I use CakePHP 2.4.4 with Oracle database? I looked in
Model/Datasource/Database/ there only seems to be support for Mysql,
Postgres, Sqlite, Sqlserver. But working with an existing Oracle
database is my job's requirement. I would be thankful for any tips.
Thank you.
No it's not possible. Well, not if you want to use some official driver. You can find a driver here : http://searchcode.com/codesearch/view/40032847
You will probably have to make some modifications to this driver to be able to make more complex queries.
In your config file, you will need to add your database connection information this way :
class DATABASE_CONFIG {
public $default = array(
'datasource' => 'Database/Oracle',
'driver' => 'oracle',
'persistent' => false,
'host' => 'hostname',
'login' => 'username',
'password' => 'yourpassword',
'database' => '(DESCRIPTION=(ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = hostname)(PORT = 1521)))(CONNECT_DATA=(SID=mysid)))',
'prefix' => '',
);
Also it does not support using a different schema than the one you log in with so you need to create a trigger on your db to switch automatically to the schema you want to work with on login.
I hope this helps in getting you started.
I would suggest you use Zend instead of Cakephp.
Also see this post :
Using Oracle database with CakePHP 2.0

CakePHP 1.3 - Having problems baking with oracle

The comand 'cake bake all' works fine when my database is MySQL, but it fails when I try to generate the mvc code using Oracle.
The application works as expected when the database.php file is modified to use my oracle database after to generate the mvc code using MySQL.
So I believe the oracle isn't the problem.
How can I get 'cake bake all' working when oracle is my default database?
database.php code:
var $default = array(
'driver' => 'oracle',
'persistent' => false,
'login' => 'LOGIN',
'password' => 'PASSWORD',
'database' => 'IP:1521/DATABASE'
);
You a have to make sure you are using proper database for the cakephp you are using and also supports the version of php and wamp / mamp / lampserver
then start configuration.
Databases supported by CakePHP
Find list of Databases supported by CakePHP from here
Find list of Drivers from here
and configure it. some thing like here Configure PHP-sqlsrv Wamp Server

Resources