Category: MySQL

Enable mysql server on Debian 10

Debian 10 by default ships mariadb, here are the steps to add the official mysql repository to your system and enable the server. Download the MySql apt repository to your system, and install the package as root, or with sudo privileges. You can find the latest version at this location: At the time of writing, latest is 0.8.15-1, so now we can use wget to get that file into the system and install it […]

Checklist: install and configure MySQL in Ubuntu 18.04 LTS

Update the repository index: # apt-get update Install the MySQL Server: # apt-get install mysql-server Verify status and installation: # mysql –version Secure local installation: # mysql_secure_installation (at the very least remove anymous access and sample stuff) Start mysql shell: # sudo mysql Verify authentication for root: > SELECT user,authentication_string,plugin,host FROM mysql.user; If set to auth_socket, change to mysql passwords: > ALTER USER ‘root’@’localhost’ IDENTIFIED WITH mysql_native_password BY ‘password’; Reload the grant tables: > FLUSH […]

Using LINQ with MySQL

This code demonstrates access to OSCOMMERCE database objects which are hosted on a mysql server, through the enitity framework and LINQ. Additionaly, the connectionstring is overriden at runtime to seperate developent and production environments. Install the MySql connector for visual studio Add a ADO.NET Entity data object to the solution Use the Wizard to create the object context (adding the tables product and products_descriptions for this example If you use VS2012: Remove the .tt files […]

Backup and restore a MySQL Database from the command line

Creating a backup from the command line on the source server mysqldump -h localhost -u username -p database_name > backup_db.sql Restoring this backup to an existing, empty database on the target server mysql -u username -p database_name < backup_db.sql When scheduling your backup with a batchfile you can use a simple trick to include a day stamp, something like below will producte a different backup file for erach day the script is run: md \dbbackup\mysql […]