I have deployed my play! application on http://www.playapps.net/.
All seemed to start OK but for some reason my queries are not working.
I have imported my script from local to their server and even I have the error:
Access denied for user 'play'#'localhost' to database 'da' (but it created my tables into their play schema there and imported my data).
Can this error be an issue for my not displaying data from DB?
Because I see no error in the logs.
Is here anybody who deployed app on this hosting solution and had this error also?
UPDATE: I've solved the above error, so now the import of my tables is done directly in play database. I log in with ssh user, open mysql console and I can see the tables.
But still, the query from my site is returning empty results. And locally it works perfectly.
Do I need any other configuration apart of this?
%playapps.application.mode=prod
%playapps.application.log=INFO
%playapps.db=mysql:play:play#play
%playapps.jpa.ddl=update
Very ugly situation.
My tables were not with capital letters. Play was looking for "Magazine" table (it created it but was empty) and I had also "magazine" table populated.
Maybe it will be useful for someone.
Ps: what was quite strange was that locally, on windows it worked.
Related
I have a database that I have created for a friend of a mine that he would like to store his data and work directly from on a daily basis. Recently I came across ExcelforMySQL and thought this would be a perfect AddIn for him to use.
I have successfully linked the AddIn to the database (Xampp Local connection) and this loads up fine but when I move the database onto a webserver that I have with ionos(1and1) and enter the Host Details along with the Username and Password, I get the following error:
Connection attempt failed.
Unable to connect to any of the specified MySQL hosts.
When I click Show Details:
All it says is One or more errors occurred.
Would really appreciate it, if somebody could advise on how to fix this, as I really want to be able to work live on the data and update the changes from the user directly in Excel if possible and this addin looks like it does that.
If anyone has any other suggestions then I am happy to hear them as not fussed as what is used as long as it works.
Thanks
I had a similar problem to yourself with a number of my own sites/DB's hosted on Ionos. After a bit of searching through their help they state that access from outside your Ionos package is not possible. Unfortunately we're stuck with their hosted version of PHP My Admin in the control panel.
Although I have found that MySQL-front works great and bypasses the Ionos restrictions. Google is your friend...
Maybe a bit late for you but for others who come across this question as I said google is your friend...
Recently, the left-pane DB preview in PHPMyAdmin lost the Functions folder. Already struggling the entire day to search a solution, but I cannot find anything similar to this problem. Together with this problem, I notice that when I hit the Structure view of a table it doesnt load anymore the table structure, but via MySQL command line though I can see everything.
Following various other topics on other phpMyAdmin left-pane view problems, I have verified that my user has ALL privileges.
Restarting MySQL (MariaDB actually) causes no change in the above results
I expect as so far the left-pane to show me the Functions folder as well as showing me the tables structure
I have just found the solution after 1 day of searches: this one worked perfectly MySQL Error 1 (HY000) Trouble creating file Errcode 2
Been tasked with moving a code first database from MSSQL to MySQL. After a few hours of kung fu, I was able to get the asp.net core project to properly deploy all migrations to mysql. Now I need to migrate the data inside of the existing mssql tables. I saw posts mentioning MySQL Migration Toolkit but that appears to be old. Also attempted to do so with MySQL Workbench and DBLoad's Data Loader but haven't had any luck.
Table structure is pretty simple with incremental integer keys + the usual crap with asp.net core identify framework (GUID). Just need to keep that consistent during the migration. What is the best way to migrate the data now that the table structure is setup in MySQL? Any recommendations would be greatly appreciated!
Update: Some more details...
I attempted a direct migration of the database from MSSQL to MySQL using MySQL WorkBench and DBLoader. But failed on the ASP.net Identity tables big time plus other issues. .net core api took a huge dump in multiple places so that idea is out.
From that point, I migrated the api controller over to mysql and then had to fix a myriad of issues related to mssql fks being too long and a few other issues.
So at this point, the controller works on mysql. I just need to dump all of the data into MySQL and keep the FKs consistent.
I have had a few thoughts with it such as CSV export>import and/or trying a few other things. Any recommendations?
You can use Data Export wizard built-in with SqlServer Management Studio (task -> Export Data)
or use SSIS package to migrate data.
Tried MySQL Workbench, DBLoad from DBLoad.com etc to migrate the data directly and they all failed.
So ended up finding a "solution"...
First off, I modified the ASP.net Core project with:
//services.AddDbContext<ApplicationDbContext>(options =>
// options.UseSqlServer(
// Configuration.GetConnectionString("DefaultConnection")));
services.AddDbContext<ApplicationDbContext>(options =>
options.UseMySql(
Configuration.GetConnectionString("DefaultConnection")));
Then went to Package Manager Console and ran: update-database
This created all of the tables in MySQL.
Then opened up Microsoft SQL Management Studio. Right clicked on the database Tasks > Generate Scripts. Saved everything to one file with Advanced option Schema and Data selected.
Then opened the db script in Notepad++ and applied the following edits using Replace with Extended Search Mode enabled:
GO -> blank
[dbo]. -> blank
[ -> blank
] -> blank
)\r\n -> );\r\n
\r\n' -> '
DateTime2 -> DATETIME
After edits were made in Notepad++, I removed all of the SET, ALTER and CREATE related stuff from the text file and then copied all of the insert lines into MySQL Workbench in order to ensure foreign keys were already populated before that table's data was inserted. Thank goodness there were no Stored Procedures to deal with! What a pain in the tucus!
Also on a side note, the app is hosted on Azure. Spent a couple of hours fighting the API not connecting to the database. This was not apparent at first as the app was fake throwing a 404 error to Postman. When I first attempted to wire up the API controllers to the MySQL DB, I entered the database connection string into Azure's App Service Configuration. It didn't work at all even though running the app locally worked fine. Ended up finding another post on this here site mentioning to get rid of the database connection string out of the App Service > Configuration window. Worked like a champ after that. All of the data with its auto incremented keys linked up without issue.
I am very pleased with the results and hope I never have to go through this process again! It is always a nice feeling to know an app now runs on a completely open source infrastructure. Hope this helps someone. Good luck.
I am getting errors in Access when attempting to open both the database
and the table.
Error: 'Id' is not an index in this table
Please help me, this is in production.
May Anyone Please share their expertise if come across with same scenario
It means that database corrupted.
Try to restore database as it described here. Also check this, item 20 and this. And finally check how to prevent corruption.
I also had this error message. Unfortunately the links provided by Sergey only helped in so far as that it became clear to me that my Current DB was unrecoverable.
I fixed the issue by:
Creating a new Access DB
Manually exporting each table from the old one (Access still allowed me to export to another DB, eventhough I got the error message on each and every export)
Recreating all necessary relationships between tables in the DB
Note: This solution worked well for me because the error appeared in the backend of my DB. If you have an unsplit DB, this could be a huge effort.
Recently I started to use Linux (Ubuntu 9.10) instead of windows. I am working on a java web application with Spring, MYSQL with jpa. However, before to install linux I made a backup file from the database, then installed linux, installed the MYSQL Query Browser and Administrator tools, and using the Admin tool restored the backup file, then got all the tables and made a simple select statement from one of the tables and got result normally and everything seems to work just fine.
There a USER table, and there's a namedQuery defined to get a user by userName, the problem is that when I pass a correct userName I still get nothing!
I really don't know what is the problem! The application was working perfectly under windows!
Please, can anyone help me to solve this problem?
Thank you in advance.
The first thing that comes to mind is that MySQL table names are case sensitive on Linux but not on Windows. i.e. this might have worked on Windows:
SELECT ... FROM User ...
but on Linux you need to use the correct case for the table name:
SELECT ... FROM USER ...
but without more information it's really difficult to tell.
There are some settings that have different defaults under Windows and Linux, case sensitivity of table names etc. being one of them. It could be that a non-specified setting defaulted to one value on windows, but another under linux.
You're all right, and for my case I found out why wasn't I able to login passing the userName!
The problem is that when I restore schema from the backup file, all the tables are being created with lower case names, for example, the USER table would be user, then..
When I boot up tomcat, JPA creates automatically all the #Entity, therefore it creates a User tables for the #Entity User, the result is that I have two tables for USER, a user table which has all the data, and an empty User table, and this is the one that is used by the application! That's why I was not able to retrieve any data because actually there's no data to retrieve from the table.
A workaround to solve this problem I modified the backup file renaming all the tables as expected by JPA to avoid creating them again when booting up the application.
I really don't know if there's a better solution, but it worked like this for me.
Finally, thank you very much for your help.