How WordPress select database engine while installing website? - wordpress

Is this default database storage engine? I want to install my WordPress website with MYSQL "NDB CLUSTER" storage engine. I tried to install wordpress site, but it's installed with InnoDB. Please help me to resolve this.
I used this SET storage_engine=NDBCLUSTER; in mysql.

There are two ways to migrate InnoDB tables with foreign keys to NDB.
Dump the database and edit the script so each table specifies ENGINE=NDB before re-importing the script to a new database
Drop the constraints, alter the tables to use the NDB engine, and recreate the constraints
Dumping the database and editing the script is a straightforward use of mysqldump and a text editor.
Converting InnoDB Tables to MySQL Cluster
it might helpful for you

Related

Export MySQL Workbench model to SQLite database

I am working on a database design in MySQL Workbench and would like to use SQLite to make a small demo. I am looking for a way to export my model into SQLite files with tables & relationships set up.
I tried this plugin (https://github.com/tatsushid/mysql-wb-exportsqlite) but it seems that it is not working anymore.
Any suggestions?

SilverStripe FulltextSearch causing database error

I'm following this tutorial:
https://www.cwp.govt.nz/guides/core-technical-documentation/framework/en/tutorials/4-site-search
I've finished the first step of adding FulltextSearchable::enable(); to mysite/_config.php. I then run the dev/build as suggested but instead of completing successfully, I get this error:
[User Error] Couldn't run query: ALTER TABLE "File" ADD fulltext
"SearchFields" ("Filename","Title","Content") The used table type
doesn't support FULLTEXT indexes
Google tells me that my MySQL database is in the incorrect format. However SilverStripe automatically generates a database for you. I could change the database format, but I don't think changing the database format is the correct approach here as other users appear to have the module working.
Any help would be appreciated.
As far as my memory serves me right SilverStripe creates the tables as InnoDB. MySQL 5.5 documentation says that FULLTEXT indexes are supported by MyISAM tables. InnoDB support for FULLTEXT indexes comes in 5.6.
Full-text indexes can be used only with MyISAM tables. (In MySQL 5.6 and up, they can also be used with InnoDB tables.)
You need to change your tables to MyISAM or update MySQL.
Here is a good guide for changing table types. In case the site goes down, here are the good points:
Steps to follow:
Take backup of Mysql database.
Run this sql query via terminal or in phpmyadmin for the database which you wish to convert into MYISAM.
mysql -u username -p -e "SELECT concat('ALTER TABLE ', TABLE_NAME,' ENGINE=MYISAM;') FROM Information_schema.TABLES WHERE TABLE_SCHEMA = 'db_name' AND ENGINE = 'InnoDB' AND TABLE_TYPE = 'BASE TABLE'" | tail -n+2 >> alter.sql
Note: Change db_name with your actual database name
Import that alter.sql file into INNODB database
EDIT: Of course you can only change those tables that need to be FULLTEXT indexed.

restore database to server via create script

i have created my DB in plesk control panel then genarate script from local to run it in query to restore database , all work done , succesfuly connceted to DB , just now it cant find my tables and store procedures as i ran the query. what is the best way to upload my db ?
For MySQL databases Plesk has built-in support of phpMyAdmin. Just open it and choose to import DB in top menu. You may need to have phpMyAdmin installed locally to export local DB in a file. Alternatively I think you can use mysqlbackup tool or read phpMyAdmin documentation for more details about import file format.

Load sqlite database into Postgres

I have been developing locally for some time and am now pushing everything to production. Of course I was also adding data to the development server without thinking that I hadn't reconfigured it to be Postgres.
Now I have a SQLite DB who's information I need to be on a remote VPS on a Postgres DB there.
I have tried dumping to a .sql file but am getting a lot of syntax complaints from Postgres. What's the best way to do this?
For pretty much any conversion between two databases the options are:
Do a schema-only dump from the source database. Hand-convert it and load it into the target database. Then do a data only dump from the source DB in the most compatible form of SQL dump it offers. Try loading that into the target DB. When you hit problems, script transformations to the dump using sed/awk/perl/whatever and try again. Repeat until it loads and the results match.
Like (1), hand-convert the schema. Then write a script in your preferred language that connects to both databases, SELECTs from one, and INSERTs into the other, possibly with some transformations of data types and representations.
Use an ETL tool like Talend or Pentaho to connect to both databases and convert between them. ETL tools are like a "somebody else already wrote it" version of (2), but they can take some learning.
Hope that you can find a pre-written conversion too. Heroku one called sequel that will work for SQLite -> PostgreSQL; is it available without Heroku and able to function without all the other Heroku infrastructure and code?
After any of those, some post-transfer steps like using setval() to initialize sequences is typically required.
Heroku's database conversion tool is called sequel. Here are the ruby gems you need:
gem install sequel
gem install sqlite3
gem install pg
Then this worked for me for a sqlite database file named 'tweets.db' in the current working directory:
sequel -C sqlite://tweets.db postgres://pgusername:pgpassword#localhost/pgdatabasename
PostgreSQL supports "foreign data wrappers", which allow you to directly access any data source through the DB, including sqlite. Even up to automatically importing the schema. You can then use create table localtbl as (select * from remotetbl) to get your data into the actual PG storage.
https://wiki.postgresql.org/wiki/Foreign_data_wrappers
https://github.com/pgspider/sqlite_fdw

sqlite in yii framework

I am following the blog tutorials of YII Framework to get insight to it.
This tutorial is using SQLITE for database. I have never use SQLITE before. I have being using MYSQL and SQL SERVER. For MYSQL I can use phpmyadmin to create database and table integrated in WAMP. Here, I am not getting idea how to create database and table in SQLITE for the blog tutorial in link. Is there any quick reference for it.
On the very next page of the tutorial is the following tip:
Tip: To execute SQL statements, we may use the sqlite3 command line tool that can be found in the SQLite official website.

Resources