I try to migrate from MySQL 5.7 to PostgreSQL 11.6 with pgloader on Ubuntu 18.04.
pgloader -v -d mysql://mysqluser:secret#localhost/dbnamesource pgsql:///postgres:secret#localhost/dbnametarget
MySQL and PostgreSQL user exist and can login on command line. Both have GRANT rights.
The above scripts output:
sb-impl::*default-external-format* :UTF-8
tmpdir: #P"/tmp/pgloader/"
2019-12-17T08:29:55.019000Z NOTICE Starting pgloader, log system is ready.
2019-12-17T08:29:55.029000Z INFO Starting monitor
2019-12-17T08:29:55.033000Z INFO Stopping monitor
The target database is empty.
Where ist the problem or what can i do to find the problem?
yeah, there is one slash too much (after pgsql:). Now it works:
pgloader -v -d mysql://mysqluser:secret#localhost/dbnamesource pgsql://postgres:secret#localhost/dbnametarget
Related
From my syslog:
mysql[1663]: ERROR 1577 (HY000) at line 1: Cannot proceed because system tables used by Event Scheduler were found damaged at server start
I tried this command to find damaged tables:
mysqlcheck -A --auto-repair --password
but all tables are OK. What's to do now?
EDIT
I also tried
sudo mysql_upgrade -u root -h localhost -p --verbose --force
but everything is OK. Still get the error.
I had the same problem, altough I didn't notice any errors or problems, I got those warnings. They seemed harmless.
I use MariaDB Ver 15.1 Distrib 10.3.22-MariaDB, for debian and your command fixed the issue perfectly:
mysql_upgrade -u root -h localhost -p --verbose --force
After lot of R&D finally i found solution...........
Basically its happen with mysql 5.7.10 version or earlier versions.
I was getting this error with event table(Mysql event scheduler).
solution-
click on start menu => search for Mysql installer => click on upgrade=> upgrade all mysql => it's really work.............!
I use Navicat for structure synchronisation and it's usually hassle-free, but with this problem I wasn't able to correct the base issue on shared hosting. Unticking 'Compare events' under 'Options' on the screen for selection of Source and Target allowed the structure synch to proceed unhindered.
I Downloaded MySQL 5.7.10 to my Mac El Capitan 10.11.2 and installed, then started MySQL from Preferences. Then I ran "cd /usr/local/mysql/bin/". Then when I do "ls" I see "mysql". So all looks installed correctly.
I am now following the MySQL tutorial to start a database instance (ultimately I want to run some CREATE TABLE scripts). But, "user$ mysql -u root" gives me -bash: mysql: command not found" .
My final goal is to do my SQL commands against a MySQL instances using an IDE like MySQL Workbench or Jetbrains Datagrip. But I am stumped.
I do not get "mysql> "
Try /usr/local/mysql/bin/mysql -u root. If that works, then you need to alter your $PATH environment variable to include /usr/local/mysql/bin.
I am using Centos 6.5 and have just installed MariaDB-sever and MariaDB-client a while ago.
The first problem is that I start MariaDB by the command /etc/init.d/mysqld start instead of /etc/init.d/mysql start (because there is no mysql file in init.d). So currently I am baffled because I don't know what I started is MySql or MariaDB.
That leads to the second problem. According to their Knowledge base, I tried mysql -u root -p to log in. But it displayed MySql instead of MariaDB, about which I feel wrong:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.1.73 Source distribution
MySQL [(none)] >
So, am I running MariaDB or MySQL?
Yes, what you have started is wrong - it is running MySQL 5.1.73. You should uninstall your "distribution" provided MySQL (which ships with CentOS 6.5) and just install MariaDB.
You can do this by looking at: rpm -qa |grep -i mysql and removing those packages. Just do a clean install of MariaDB and you should be fine.
Some distributions ship /etc/init.d/mysqld, some - /etc/init.d/mysql . It makes no difference, just different script names.
MariaDB origins from MySQL, so if you see MariaDB in the prompt then it's MariaDB. You will never see MariaDB in Oracle's MySQL.
I get this error on my Ubuntu 12.04 machine with mysql 5.5 after I imported some Wordpress content to Mezzanine's blog_blogpost.
ValueError at /admin/blog/blogpost/
Database returned an invalid value in QuerySet.dates(). Are time zone definitions and pytz installed?
Request Method: GET
Request URL: http://127.0.0.1:8000/admin/blog/blogpost/
Django Version: 1.6.1
Exception Type: ValueError
Exception Value:
Database returned an invalid value in QuerySet.dates(). Are time zone definitions and pytz installed?
Exception Location: /home/me/.mezenv/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py in results_iter, line 1107
Python Executable: /home/me/.mezenv/bin/python
Python Version: 2.7.3
Python Path:
[u'/home/me',
'/home/me/sai',
'/home/me/.mezenv/local/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg',
'/home/me/.mezenv/local/lib/python2.7/site-packages/pip-1.1-py2.7.egg',
'/home/me/.mezenv/lib/python2.7',
'/home/me/.mezenv/lib/python2.7/plat-linux2',
'/home/me/.mezenv/lib/python2.7/lib-tk',
'/home/me/.mezenv/lib/python2.7/lib-old',
'/home/me/.mezenv/lib/python2.7/lib-dynload',
'/usr/lib/python2.7',
'/usr/lib/python2.7/plat-linux2',
'/usr/lib/python2.7/lib-tk',
'/home/me/.mezenv/local/lib/python2.7/site-packages']
Server time: Sat, 25 Jan 2014 13:44:11 +0100
Error during template rendering
In template /home/me/.mezenv/local/lib/python2.7/site-packages/grappelli_safe/templates/admin/change_list.html, error at line 140
I added to my local_settings.py
import pytz
from pytz import *
and also defined timezone in my.cnf [mysqld]
default-time-zone = "+01:00"
but I still get the error unitl I get the line in template:
the tag is:
140 {% block date_hierarchy %}{% date_hierarchy cl %}{% endblock %}
Appreciate your help to resolve it.
Looks like error caused Django's 1.6 timezone functionality changes. The docs now mention this error specifically (bug report, link to docs).
You have to load timezone tables into mysql (http://dev.mysql.com/doc/refman/5.6/en/mysql-tzinfo-to-sql.html).
Try execute on your database server:
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -D mysql -u root -p
And then run "flush tables" or "flush query cache", otherwise the problem may not disappear even though you've loaded the correct timezone data:
mysql -u root -p -e "flush tables;" mysql
updated by #qris
What worked for me:
1. Populate the timezone definitions in the 'mysql' table
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql
2. Flush tables
mysql -u root -p -e "flush tables;" mysql
3. Restart mysql
sudo service mysql restart
For MacOS users I found solution here (in comment):
mysql_tzinfo_to_sql /usr/share/zoneinfo | sed -e "s/Local time zone must be set--see zic manual page/local/" | mysql -u root mysql
Because on MacOS we have error looks like this:
$ mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u roomysql
Warning: Unable to load '/usr/share/zoneinfo/+VERSION' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/Asia/Riyadh87' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/Asia/Riyadh88' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/Asia/Riyadh89' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/Mideast/Riyadh87' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/Mideast/Riyadh88' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/Mideast/Riyadh89' as time zone. Skipping it.
ERROR 1406 (22001) at line 38981: Data too long for column 'Abbreviation' at row 1
For Windows, take the following steps:
stop the service
download the files provided by MySQL but note they go in C:\ProgramData\MySQL\MySQL Server VERSION\data\mysql not in C:\Program Files\MySQL\MySQL Server VERSION\data at least on Windows 7 as of 2014.
I also modified C:\Program Files\MySQL\MySQL Server VERSION\my.ini to add default-time-zone = 'UTC' per the tips here. Then restart the service.
For anyone else passing through here with the same issue on Mavericks I was getting the error mentioned by Anton whereby I kept getting;
ERROR 1406 (22001) at line 38981: Data too long for column 'Abbreviation' at row 1
So I used mysql_tzinfo_to_sql tz_file tz_name from the MySQL docs to load the specific time zones that I wanted;
mysql_tzinfo_to_sql /usr/share/zoneinfo/GMT GMT | mysql -u root -p mysql
mysql_tzinfo_to_sql /usr/share/zoneinfo/UTC UTC | mysql -u root -p mysql
And now Django isn't returning errors so I'm happy :D
The Django docs actually talk about this problem:
I get an error “Are time zone definitions for your database and pytz installed?” pytz is installed, so I guess the problem is my database?
If you are using MySQL, see the Time zone definitions section of the MySQL notes for instructions on loading time zone definitions.
If you follow that link, you get this advice:
If you plan on using Django’s timezone support, use mysql_tzinfo_to_sql to load time zone tables into the MySQL database. This needs to be done just once for your MySQL server, not per database.
Here's the command:
mysql_tzinfo_to_sql /usr/share/zoneinfo/ | mysql mysql
Loading Time Zone for Mysql solved the problem for me.
If you are on windows, follow these instructions :
Step #1: Download the package that contains the data files of pre-built time zone tables.
http://dev.mysql.com/downloads/timezones.html
Step #2: Unzip the downloaded ZIP file to a folder on your Desktop.
Step #3: Stop MySQL Server.
For Xampp and Wamp use their GUI or stop the mysql service from the Task Manager.
Step #4: Open mysql subdirectory of your MySQL server's data directory.
For me it is C:\xampp\mysql\data\mysql
Step #5: Overwrite time zone data files with the downloaded version.
Copy all 15 data files from your unzipped folder and paste into data folder for the mysql system database. Overwrite all these .frm, .MYD, and .MYI files.
Step #6: Restart MySQL server.
And the job is done :-)
source : http://www.geeksengine.com/article/populate-time-zone-data-for-mysql.html
I am new to both linux and also mysql but somehow by obtaining help from net I have installed mysql v5.5 on redhat. It starts fine, I have confirmed this by running command:
"/etc/init.d/mysqld status"
But I am not able to change password using command:
mysqladmin -u root password 'new-password'
It gives error : bash: mysqladmin: command not found.
I tried searching mysqladmin by using command "find / -name mysqladmin" but it returned no result
All I can search on net is adding to path '/bin:/usr/local/mysql/bin' but directory structure after installation mysql v5.5 has changed. There is no such directory like /usr/bin/local/mysql now.
please help me with how to run mysql after changing root's password.
first of all see what MySQL packages are installed
rpm -qa | grep -i mysql
Second, try using locate in order to find the tool path
BTW,
According to pbone mysqladmin is provided by mysql-client (rather than mysql) as it was on older cackeages