Hi I'm trying to migrate a database that was created with cakePHP on a local MYSQL database. I know that in rails the solution is to install the postgres gem that will handle the migration, but I'm wondering more specifically about cakePHP.
I've generated a sqldump of the mysql database using the solution here:
http://book.cakephp.org/2.0/en/console-and-shells/schema-management-and-migrations.html
I've also installed postgres locally onto my machine and am able to connect to my remote empty HEROKU database from the command line by using heroku pg:psql
However, if I run the SQL dump file directly in the console I get an error called SSL SYSCALL error: Software caused connection abort. This apparently is because as a DEV / Free database account you are restricted from entering SQL commands directly.
So, that would suggest that I would have to go and use something like
heroku db:push localdatabase herokudatabase
But that produces the error Sequel::AdapterNotFound -> LoadError: 193: not a valid Win32 application
Any ideas how I might manage this migration, bearing in mind that as it's a CakePHP application I do not have the option of just installing a PostGres gem?
Thanks for any direction, or thoughts.
You almost certainly want to install Postgres locally on your machine, and get your database and code working correctly there. Once it's set up, it's easy to do a dump of your Postgres database and upload to Heroku.
Related
How do I install MySQL Workbench properly? Can't connect to the SQLTools extension in VSCode.I'm new to the database scene, and can't seem to grasp how to create a successful SQL server that I can use to manipulate data. But nothing I'm doing seems to work.
Should I use Gitbash to access the terminal? I tried using my password to make a new query but it wouldn't work on the workbench. I don't know how to start the SQL server in addition to not knowing how to properly change the profile for the Workbench from a previous account. A new developer, such as myself, would appreciate any insight!
So that's really simple just install the mysql community server installer using this link https://dev.mysql.com/downloads/mysql/
Make sure to select the server only in the setup during installation if you are going to be using VS code as the client to manipulate sql queries
Then once that is done copy the bin path location from the mysql file directory (which is usually in the program files on your \C: drive on your computer) to the environment variables on your computer so that you can access mysql from the command line
Once that is done you can initialise a database from the normal command line but first type mysql -u root -p to start mysql in the command line
Then download the sql tools extension on vs code and create the database that wish
I'm used to MS SQL and Management Studio on Windows but got MacBook recently, and appereantly, I don't have enough RAM for the tasks I need to do on my Parallels Desktop.
Thus, I installed MySQL on my Mac and been able to create a database via MySQL Workbench.
I can see the database exists when I type in
SHOW DATABASES;
However, whenever I want to connect to the localhost server via a client (Sequel Pro), using the same connection informations as I used to Workbench, I get this error message:
MySQL said: Authentication plugin 'caching_sha2_password' cannot be
loaded: dlopen(/usr/local/lib/plugin/caching_sha2_password.so,
0x0002): tried: '/usr/local/lib/plugin/caching_sha2_password.so' (no
such file)
Help would be appreciated.
Thanks!
I'd strongly suggest you to use Docker to run Databases locally instead of installing them.
This gives you lots of advantages (eg: only run it when you need it) and moreover there are plenty of documents around that tells you how to quickly run and connect to it.
For example --> https://dbschema.com/2020/03/31/how-to-run-mysql-in-docker/ (the real first result found duckduckgoing it :))
I want to host a django project on heroku. Locally, I developed it using MySQL database. And I have also pushed it to heroku but I get an Error message whenever I run heroku open command on command prompt. The error message is Can't connect to local MySQL server through socket. Though I'm a newbie in using databases, the way I understand the error is that heroku can't connect to local MySQL server which I'm using for local development. I don't want to connect to a remote MySQL database, instead, I want to connect to Postgre database just as heroku recommended.
Being a newbie in the use of database, I don't know the best way to migrate to Postgre or how to add MySQL in my project to .gitignore. Is it possible for me to start running Postgre on heroku while MySQL isn't added to . gitignore and is still the database in settings.py? Must I clear MySQL database or add it to gitignore before I can use Postgre?
PostgreSQL settings for Heroku:
Please install dj_database_url using below command:
pip install dj-database-url
In settings.py , import dj_database_url and add below settings at the end of the file:
import dj_database_url
db_from_env = dj_database_url.config(conn_max_age=500)
DATABASES['default'].update(db_from_env)
Done !! Now, deploy again to Heroku.
I have recently downloaded Wavemaker because I feel it best suites my needs, however when I try and connect to my database on a mysql server hosted with godaddy, I keep getting access denied. However I can connect using exactly the same loggin info for sql workbench and razorsql just to see if I had my credentials correct and I have no problem connecting using those other two tools, is it me or is wavemaker being a pain?
Did you remember to install the MySQL JDBC DRIVER?
If not you can get it from the MySQL site, or install it on your Linux machine using the appropriate install commands. I had the same problem and after installing the driver everything worked great.
I'm posting my WaveMaker MySQL connection info (the database properties file) in hopes it might help:
mafiamgr_warmturkeyDB.connectionUrl=jdbc\:mysql\://localhost\:3306/mafiamgr_warmturkey?useUnicode\=yes&characterEncoding\=UTF-8&zeroDateTimeBehavior\=convertToNull
mafiamgr_warmturkeyDB.tableFilter=.*
mafiamgr_warmturkeyDB.driverClassName=com.mysql.jdbc.Driver
mafiamgr_warmturkeyDB.username=topsecret_xref
mafiamgr_warmturkeyDB.password=568626f144a0c56862568626f14047568626f1412a43
mafiamgr_warmturkeyDB.reverseNamingStrategy=com.wavemaker.tools.data.reveng.DefaultRevengNamingStrategy
mafiamgr_warmturkeyDB.schemaFilter=.*
mafiamgr_warmturkeyDB.dialect=com.wavemaker.runtime.data.dialect.MySQLDialect
I am using Lynda.com Rails tutorial. I created a MySQL database for my Ruby on Rails application simple_cms.
The database is called simple_cms_development.
Let's say I want to move this database into a new server, where do I find it?
I am running rvm, and I saw mysql is inside this rvm, but I am not able to access it. I searched my computer for simple_cms_development , and couldn't find anything either. Any ideas? Thanks
Copy the source code from the original machine to the new machine, or get it onto your new machine from a remote repository using git.
Run rake:db:create in the application directory on your new machine. This is assuming you have MySQL running on the new machine.
Use either the mysql client or the mysqldump utility to get a dump file of your MySQL database from your original machine.
Copy the dump file to the new machine and load it into the database using the MySQL client.
You can google the details of how to use git, dump and load MySQL, etc.
RVM is a tool for managing Ruby versions and gems. A Rails project backed by a MySQL database will need to use some Ruby gem (like mysql2) to allow the Rails app to talk to the MySQL database. All you're seeing in the .rvm directory is the gem. I'm not sure if the usual MySQL gems provide functionality to dump or load a database, at any rate you may as well use the MySQL client directly.