Mysql in eclipse indigo - mysql

I Have run an Hibernate application, where it should create a table name Userdet and insert values for username & userID. But when i drag down the MySQL database Poo i cant find any table been created. But Hibernate application ran successfully.

Are you possibly using "create-drop"? That causes schema to be dropped when SessionFactory is closed. If so, other options to create database via Hibernate are create and update.
Other common mistakes are connecting database other than assumed and/or checking wrong schema.

Related

jhipster recreate database tables

using jhipster I have created Angular based Monolith application (MySQL) and loaded jdl file, everything is working fine. But by mistake I have dropped MySQL database schema. Now I have recreated the database schema, but now when I run ./mvnw, it is not creating the database tables and entries any more even the login and authentication tables were also not created? Is there settings change I need to make to recreate the database all the database tables?
Liquibase does not create the schema, it creates tables, indexes, ... but only in a pre-existing database/schema. You must re-create your schema.
You can create schema from liquibase, but not a database, so you must just create database, and for schema you can use this:
<sql> CREATE SCHEMA yourSchema </sql>

PHPMyAdmin Designer doesn't show all tables

I have created a MYSQL Database using XAMPP and PHPMyAdmin.
The Database has been firstly created using a MYSQL script which created and connected all tables.
In a second time I had to create and connect the table "Pietanza_nel_ordine". I created it with another SQL Query and then I connected the Foreign Keys using the tools provided by PHPMyAdmin.
This table works correctly even with Foreign Keys, however it is never shown in the Designer tool in PHPMyAdmin.
How can i get it to be shown?
Server version is 5.6.26, protocol 10.
PHPMyAdmin version is 4.4.14
I provide you with a few screenshot about my configurations:
Designer View:
Tables list:
Table Ordine:
Table Pietanza_nel_ordine:
I finally found out which was the problem:
The new table was added to my DB, but it wasn't added in designer schema.
I found out the option "Add tables from other databases" in the Designer View left dropdown, which allowed me to add my new Table in the Designer View (even if it was in the same Database).

phpmyadmin Error: Relational features are disabled

When I try and create a relationship between two tables I get the error -
"Relational features are disabled".
I've seen that updating phpmyadmin could possibly solve the issue, but I don't have access to do this. I contacted hostgator and they say I'm unable to do this and I would have to upgrade to a different plan in order to upgrade phpmyadmin.
I'm currently running version 4.3.8.
Is there any other fix for this error to allow relationships to be created between tables?
you have to convert your table/db engine to InnoDB with this query :
ALTER TABLE table_name ENGINE=InnoDB;

What changes I need to do on the restored DB and how?

I have restored a DB from "mixed authentication" MS SQL Server into "windows authentication only" SQL Server.
My application is configured for windows authentication which uses 'dbo' for accessing DB.
But in the restored DB , all the tables, views are NOT owned by 'dbo'
Im not really sure if i understood the question, but i guess when you accessing database, you are/was creating the tables. Most possibly your statements was like:
Create Table TableName (...)
To create tables in specific schema, you should add schema prefix (or change the default schema of user you are using):
Create Table dbo.TableName (...)
To move tables to other schema, see Alter Schema.

Linq to SQL DBML Access across a Linked Server?

I have a DBML on a single database in a named instance. The instance has a linked server to another MSSQL database in another server/instance. Both instances and databases have the same dbo-level user. Both databases are MSSQL 2008.
I have some C# code (Framework 3.5) that uses the DBML that accesses the tables and views and sprocs on DatabaseA. I now need to access a table on DatabaseB. What is the smartest way for my code to get to the table/entity over the linked server connection?
Thanks.
One clean way of doing this is to create views inside DatabaseA that encapsulate enities on the other side. You will have to manually define the primary keys and relationships for these entities in your .dbml file. Once this is done they can work just like any other table with CRUD functionality as long as the DTC service is running on DatabaseA.
Try adding a linked server to your local:
EXEC sp_addlinkedserver
#server=N'SERVER',
#srvproduct=N'',
#provider=N'SQLNCLI',
#datasrc=N'SERVER';
SELECT * FROM sys.servers
EXEC sp_addlinkedsrvlogin '<SERVER>', 'false', '<DOMAIN>\<USERNAME>', '<USER>', '<PASSWORD>';
And access your local referring to the linked server:
SELECT * FROM SERVER.DB.SCHEMA.OBJECT
I had used SQL Synonyms in Entity Framework and LINQ-To-SQL, you can create a SQL Synonnym to point to a linked Server object, like this:
And then perform a SQL Query:
Northwnd db = new Northwnd(#"c:\northwnd.mdf");
IEnumerable<Customer> results = db.ExecuteQuery<Customer>
("SELECT contactname FROM customersSynonym WHERE city = {0}",
"London");
You can read the documentation here and also you can read another question like this one but using Entity Framework, which uses the same principle, using a SQL Synonym.