Skip to main content
Drupal 8

Main navigation

  • Home
    • Question And Answer
    • NEWS
    • Projects
  • Tutorials - Drupal
    • Android
    • Other
User account menu
  • Log in

Breadcrumb

  1. Home

Database

By editor , 29 November, 2017

Get table column names on Drupal 8

Tags

  • Drupal 8
  • Database
  • Module

To get database table columns names of a mysql database you can use "DESCRIBE my_table;" method.

By editor , 13 June, 2017

Alter table structure on Drupal 8

Tags

  • Drupal 8
  • Code
  • Database
  • Module

To update a table you must create a custom module. Example , Here we use mymodule.

By editor , 18 January, 2017

Use multiple databases on drupal 8

Tags

  • Drupal 8
  • Code
  • Database

Move some tables into another database.

Example:

By editor , 22 November, 2016

Handle database schemas on Drupal 8

Tags

  • Drupal 8
  • Code
  • Database

Get Database Schema

$schema = \Drupal\Core\Database\Database::getConnection()->schema();

 

By editor , 12 November, 2016

Custom Content Entity Field types of drupal 8

Tags

  • Drupal 8
  • Code
  • Entity
  • Database
By editor , 24 October, 2016

Repair MySQL Database Error

Tags

  • Server
  • Database

Repair all tables
mysqlcheck -u root -p --auto-repair --check --all-databases

Repair a database
mysqlcheck -u root -p  --repair --databases databasesname

By editor , 22 August, 2016

Change Drupal 8 text field maximum length

Tags

  • Drupal 8
  • Code
  • Drupal 7
  • Database

If there no data, You can use field_update_field (tested on D7) Like:

By editor , 8 August, 2016

Mysql Tips. Useful commands

Tags

  • Shell
  • Server
  • Database

Show all columns of a table.

Syntax: SHOW COLUMNS FROM the_table_name;
Example: Show all columns of the mysql user table.
mysql> SHOW COLUMNS FROM mysql.user;

By editor , 25 July, 2016

Drupal MySQL Database Import and Export via Drush

Tags

  • Drupal 8
  • Drupal 7
  • Drush
  • Database

Export Drupal 8 MySQL Database via Drush

drush cr
drush sql-dump > /pathto/mysql-dump-drupal8.sql

By editor , 29 June, 2016

Use multiple / external databases in Drupal 8

Tags

  • Drupal 8
  • Code
  • Database

The database settings (and connection) has 3 levels.

1. KEY
2. TARGET
3. DATA

Example:

$databases[KEY][TARGET] = array (
 DATA
);

Like:

Pagination

  • 1
  • Next page
Database

Links

  • Drupal.org
  • Drupal core release cycle
  • Drupal events with ease
  • Unit test with Drupal using PHPUnit (Drupal 10)
  • Tokens for file upload url
  • Tips for Docker
  • CKEditor inline image files usage for custom forms.
  • Install Docker on Linux Mint
  • Install PHP 8.1
  • Drupal Security Best Practices
  • Order and sort items with tabledrag
  • Add a custom service YAML container
  • Apply a patch with composer