We have just begun to think about a new project where it will be crucial to handle fractions of seconds. We will use apache as web server with php.
We will get date data like: 2012-03-31 18:20:10.015493 and want to store it in db.
After some research i noticed that mysql didn't support the fractions before version 5.6 or something. This version seems to be in development stage and therefore I don't want to use it.
What is your recommendation, use another database server or store the date as another data type in mysql ? The demands on another db server is that its compatible with apache and is open source, running on unix.
Anyone got any tips or pointers?
In PostgreSQL:
SELECT CURRENT_TIMESTAMP;
Result: 2001-12-23 14:39:53.662522-05
See more here
You should also consider MariaDB (a mysql compatible fork). They support microseconds in the current stable version (5.3).
Related
I was looking into trying out Adempiere 380 LTS specifically with MySQL. Is there a seed database anywhere that I can use? There used to be one for 360 but I'm not sure if it's still compatible (probably not).
If not any suggestions on a work around. I've started a migration of a seed PostgreSQL to MySQL but the process is slow as it requires quite a bit of manual intervention from the looks of it.
There isn't one at the moment.
The latest MySQL dump, that I can see, is available here.
You would need to either successfully migrate latest PosgreSQL database over MySQL (there's something called pg2mysql, mysql workbench also has a migration tool) or try to adapt 360's MySQL dump to the latest version of Adempiere.
Whatever the option, there's going to be quite a bit of manual work to get it working 100%.
I am bit novice in some aspects here and no related information found...
I have an AWS instance with mysql client installed at 5.5 version. And also an RDS db instance with mysql 5.6 (in order to use t2.micro). I don't think so but, could this in your opinion/experience produce some kind of trouble when requesting queries (via PHP, specifically Symfony2) between them?
I hope it is no; but if yes, is strictly necessary then to upgrade my mysql client in the instance or there is any other way to use t2.micro with mysql server at 5.5?
Any guidance or related experience would be much appreciated.
See Upgrading from MySQL 5.5 to 5.6:
Note particularly any changes that are marked Known issue or
Incompatible change.
That said, your client app should be able to use 5.6 safely, and you got it right, that is required to use db.t2.micro instances.
I am totally new to databases. I would like to create a database; I am going to make a small project which is going to use DB. I am going to use Maria DB as it is totally free for commercial use.
The question is: Can I use MySQL workbench program to create a database and then transform/change it to MariaDB?
From my experience -- Sure, you can use MySQL Workbench with MariaDB.
However, I have tried basic functionalities only, like queries, schema design etc. Not sure about compatibility of advanced features.
So my experiences are, yes you can use MySQL Workbench for MariaDB database designs.
However I needed to change the "Default Target MySQL Version" to 5.7.
This can be done by going to: Edit->Preferences in the menu. And finally to Modeling->MySQL.
Since the latest MySQL version, v8.x, the SQL statements are not compatible with MariaDB statements (like creating an index). MariabDB creating an index on a table:
INDEX `fk_rsg_sub_level_rsg_top_level1_idx` (`rgs_top_level_id` ASC)
vs
MySQL:
INDEX `fk_rsg_sub_level_rsg_top_level1_idx` (`rgs_top_level_id` ASC) VISIBLE
MariaDB can't handle this VISIBLE keyword in this example. Using an old MySQL Version, MySQL Workbench will forward engineer a compatible MariaDB SQL file.
Currently (Oct 2019) the generated SQL_MODE output is still compatible with MariaDB. Just like InnoDB, which is also preferred when using MariaDB in most cases.
Just to list a few other options:
MySQL Workbench
Heidi Sql
SQLyog
No.
The latest version of Workbench 8.0 is not supported in MySQL.
Yes, although connecting to view existing database on a remote MariaDB server will crash the current client (6.3.10). I use it mainly to deploy database models and that works fine, even on remote servers.
I just deployed to a MariaDB 10.3 server with that client and it worked fine, see screenshot.
I am doing a research regarding migrating from MySQL to MariaDB and viceversa.
As it seems, the first part should be easy and not complicated as stated here: MariaDB versus MySQL - Compatibility
It is the "viceversa" part that botters me: MariaDB -> MySQL. I just could not find anything useful about this topic.
Can anyone help? Any advice, hint? Are there complications migrating from MariaDB back to MySQL?
Thank you so much.
If there is someone who should ever take care of migrating from MariaDB to MySQL, it would be Oracle. As Oracle pretends MariaDB does not exist (company politics-policies) , it also does not provide the possibility to migrate (which does not bother me personally, because being on MariaDB team I'd prefer people to chose it and stay there :)
Having said all the above, the migration should be straightforward, provided you do not use special features (so, no storage engines besides MyISAM/Innodb). You shutdown MariaDB, you save the data directory, remove MariaDB, install MySQL, copy the saved data directory back. In the worst case you'd need to remove parameters from my.ini/my.cnf that are not recognized by MySQL.
The point I'm trying to make is since persistent data formats for most commonly used storage engines are compatible, no data migration is required (at least not yet:)
It's very easy ton migrate Mysql to MariaDB (so, no storage engines besides MyISAM/Innodb).
Backup your database
Stop mysql server
Set your repositorie
(http://downloads.mariadb.org/mariadb/repositories/), it's depend on your linux stack.
Execute commande line to install MariaDB.
But now migrate MariaDB to Mysql is more difficult. I have no solution yet for this operation. Since my last try i have crashed my server...
I'm starting to get a bit desperate in my attempts to get a ruby script to connect to MySQL.
I've given up on DBI, as I just don't seem to be able to get it to work no matter what I do. I figured I might have more luck with just using mysql.rb from ruby-mysql. However, in using that I get the following error:
./mysql.rb:453:in `read': Client does not support authentication protocol requested by server; consider upgrading MySQL client (Mysql::Error)
I gather from googling that error message that this means my version of MySQL is too recent and doesn't support old-style passwords. I'm on a shared server and don't have root access, so I can't make the changes recommended to the MySQL config.
My version, btw, is:
mysql Ver 14.7 Distrib 4.1.22, for pc-linux-gnu (i686) using readline 4.3
Has anyone succeeded in getting ruby to connect to MySQL? I've been trying under Windows, since I have admin access on my Windows machine, but if there's a way to do it without root access on Linux, that'd be even better.
Sounds like you've run in to a MySQL quirk. Some time around version 5.0 they changed the format of connect passwords. It's an easy fix, though: http://dev.mysql.com/doc/refman/5.1/en/old-client.html
(Also, check out the Ruby Sequel gem, it lets you do some real fun stuff with all sorts of databases and without the overhead of ActiveRecord: http://sequel.rubyforge.org/documentation.html )
There is a good summary of how to do this here: http://rubylearning.com/satishtalim/ruby_activerecord_and_mysql.html
I haven't had any issues with connecting to MySQL from Ruby on my test machines.
You mention that you're using a shared hosting provider. If they have that old of a ruby-mysql version that it's not compatible with the new style passwords, perhaps their support staff can make the changes you need made to the user row(s) in MySQL.
What are you looking to do? I think it is possible to use the ActiveRecord component of Rails to establish a connection to MySQL. I'll see if i can find some documentation to back this up, and i'll update this answer.
link to ActiveRecord/MySQL integration
Update: to use ActiveRecord for the purpose are looking for, you will need to create the various model classes that represent the tables you are pulling data from, and specify their relationships. Once that is done, you will be able to do something like:
SomeModel.find(:all, :conditions => ['some_column = ?', some_value]
I've used this approach in the past to provide my Rails apps with access to WordPress data.
It may be that you're using an older version of mysql and need to upgrade it.