Showing posts with label MySQL. Show all posts
Showing posts with label MySQL. Show all posts

Friday, September 18, 2015

Large amount of data? Use database




You should use a database if you imagine you will frequently record data until you may have a huge amount of data.

If you expect that you need to enter some data every fifteen seconds, you should consider using a database.

Microsoft Excel and LibreOffice cannot handle a very large amount of data. I am talking about general purpose computing. I just have a common Intel CPU. I just have 4GB of RAM.

If you imagine you will need to save a large amount of data, no office productivity suites can handle this situation.

Only use a database. A database can handle a large amount of data.

Common databases are MySQL and PostgreSQL. If you decide to use either one, it will be tricky to migrate from one to another. Please decide with your wisdom.

In my experience, different versions of MySQL were or are incompatible, meaning that upgrading from one version to another might or may cause data loss. For PostgreSQL, upgrading did not cause any data loss in my case.





Friday, August 16, 2013

C++, MySQL and "access denied" error on Debian Linux

The error message is:

ERR: SQLException in g.cpp(main) on line XX
ERR: Access denied for user 'XX'@'localhost' (using password: NO/YES) (MySQL error code: 1045, SQLState: 28000 )


My solution is:

$ invoke-rc.d mysql stop
$ mysqld --skip-grant-tables

$ g++ \
-finput-charset=utf-8 \
-fexec-charset=utf-8 \
-fwide-exec-charset=utf-8 \
-lmysqlcppconn \
-L/usr/include/mysql \
-lmysqlclient \
-I/usr/include/mysql \
-g whateverfile.cpp -o whateverfile \
`mysql_config --cflags --libs`

$ ./whateverfile


My first MariaDB installation on Debian Linux

I think that it is good to use the latest software in theory because of the fixes involved.

I use Debian Wheezy. I have installed MariaDB and have found that removing it with the Debian package manager can cause problems, e.g. a lot of dependencies to be removed. The dependencies are essential.

This issue needs to be fixed. Uninstalling is as important as installing. Now I should use MySQL, in my opinion.

Monday, August 12, 2013

Back up and restore a MariaDB database on Debian Linux

The following commands work for me in MariaDB.


This one backs up the database called databaseName:

$ mysqldump -u root -p \
--set-charset \
--default-character-set=utf8 \
--databases databaseName \
--result-file=databaseName.sql



These ones restore the database for me by using the SQL file:

$ mysql -u root -p

$ create database databaseName default character set utf8;

$ use databaseName;

$ source /path/to/sql/file/databaseName.sql;



The SQL file can be very big.
To reduce its size, do:

Sunday, August 11, 2013

Changing the root password in MariaDB on Debian Linux

The root password can be changed:

$ mysql -u root -p

$ use mysql;

# Do _not_ use YourNewPassword in your work
$ update user set password=PASSWORD("YourNewPassword") where User='root';

$ flush privileges;

$ quit

Reference:

http://www.cyberciti.biz/faq/mysql-change-root-password/


Using MariaDB with C++ on Debian Linux

I have started to learn more about MariaDB and C++. MariaDB is another version or improved version of MySQL, but it is supported by some other programmers.

Below are the steps for setting up MariaDB on Debian Linux:

$ aptitude install python-software-properties
apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db

$ add-apt-repository 'deb http://mirror2.hs-esslingen.de/mariadb/repo/5.5/debian wheezy main'

$ aptitude update
$ aptitude install mariadb-server