title: Querying a mysql database in a web project throughout a different domain than localhost retrieves no data
body: <p>Trying to understand why is happening this. When I query a different domain that I setted up on hosts file is like the data from the database is not being retrieved. I have a personal project with angular, spring-boot and mysql.  Angular query an API that is exposed by Spring that is querying mysql. When I run the project and I go to the URL localhost:8080 I get all the information, but when I go to mysite.com:8080 seems that all the data from mysql is not retrieved.</p>
  
  <p>I modified the file hosts like this</p>
  
  <pre><code>##
  # Host Database
  #
  # localhost is used to configure the loopback interface
  # when the system is booting.  Do not change this entry.
  ##
  127.0.0.1 localhost
  255.255.255.255 broadcasthost
  ::1             localhost 
  
  127.0.0.1 myownproject.com
  </code></pre>
  
  <p>and I granted all the privileges on mysql to the database mydb for the user@mysite.com</p>
  
  <p>here is my spring configuration for the database</p>
  
  <pre><code>#override the spring parameter 'create-drop', 'create' creates the schema deleting the previous data
  spring.jpa.hibernate.ddl-auto=create-drop
  
  spring.jpa.show-sql=true
  spring.jpa.hibernate.naming_strategy=org.hibernate.cfg.ImprovedNamingStrategy
  spring.jpa.database=H2
  
  database.driver=com.mysql.jdbc.Driver
  database.url=jdbc:mysql://localhost:3306/expediente_electronico
  database.username=user
  database.password=user
  </code></pre>
  
  <p>Thank you</p>