symfony - creating database with doctrine - database

let say, my database name = television
everytime I try to craate database in CLEAN symfony project (I try version 2.3 or 2.5) for developer mode, it still create database "television" .. when I try to create database for production mode, it's trying to make database with same name "television"
in developer mode it should create database "television_dev", not "television"
I had one cloned project (sylius), and in this project creating databases works fine ... I try to make sure, I have all bundles same (I mean doctrine versions), but it still not working
what am I doing wrong ? what should I config ?

in app/config/config_dev.yml add:
doctrine:
dbal:
dbname: %database_name%_dev
then you case use this command to create the db
php app/console doctrine:database:create
based on your environment either you will have television or television_dev

Related

Trying to connect to a database created in a spring boot package with intelij Datagrip

I have created a spring boot project in eclipse with a H2 embedded database and JPA. Inside my resource folder I'm using import.sql to populate the tables created in my entity package.The spring web application and database runs fine as I can check it but I want to know if it is possible to check this database in Intelij DataGrip like I can when I do this:
localhost:8080/h2-console
In my application.properties in my spring project I have this:
spring.datasource.url=jdbc:h2:file:./database/suppliersDB;
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.h2.console.enabled=true
spring.h2.console.path=/h2-console
spring.jpa.hibernate.naming.strategy=org.hibernate.cfg.DefaultNamingStrategy
spring.jpa.database-platform=org.hibernate.dialect.MySQLDialect
spring.jpa.show-sql=true
spring.jpa.hibernate.ddl-auto=create
In my Intelij Datagrip I add a data source H2 and give it the url and test connection and it says ok but doesn't show any of the tables and when I run a query in the DLL it says table doesn't exist
And I know I should probably shouldn't be using Intelij IDE since my project is in eclipse but it is just an experiment and it is frustrating me I can't get it working in Datagrip.
Also the embedded database file stored by eclipse is an .mv.db file which maybe the problem i'm not sure!
Any help would be much appreciated!
You cannot do it because the database you created is in-memory.

How to see my laravel database?

I've set functional laravel project, database connection works, I've added some tables via terminal but now I'd like to see it just as you can see everything with phpmyadmin, for example. How to locate the database file and how to open it, by default?
In Terminal:
cd into Project directory
vagrant ssh
cd into Project directory in machine
mysql -u[username] -p[password] - e.g mysql -uhomestead -psecret
Vaala! You are connected to MySQL...
SHOW databases;
USE [Database Name]; - e.g use Homestead;
SHOW TABLES; to see all tables
SELECT * from [table]; - e.g select * from users
Are you using MySQL? If so, you can install the MySQL Workbench and enter the same database credentials to view your data similar to PHPMyAdmin. Alternatively, you can install PHPMyAdmin wherever you are developing (local machine/vagrant/remote). You can also view everything in tabular format with the command line and mysql as well, but it's not very friendly.

Create new database in PhpStorm

I have database on localhost. Now I want to install some web application which needs an empty database (for example "myapplication").
How can I create such database in PhpStorm 9?
I only found the way to open the SQL-Console (CTRL+SHIFT+F10), and create in manually by entering SQL command:
CREATE DATABASE myapplication;
Ok, is not much to write, so maybe no need to have a GUI for that ?! :)

Key steps to uploading a Drupal website from Local to live using a hosting firm

I'm a newbie to pushing Drupal websites from local to live via a CP panel with a hosting company and wondered if there are any key steps I need to follow? I usually end up with Internal Server 500 errors or no themes showing so not a good start!
The steps I follow are:
Export the database from my local PHPMyAdmin
Log into my hosting CP Panel and create the database on there
Create a user for the database (with password)
Change the settings.php to match the database settings
Load all Drupal files via FTP
Create a 'tmp' folder in the 'sites > default> files' directory
What am I doing wrong?! Is it something to do with the .htaccess file as to why I either get the error or my theme never shows?
Any help would be much appreciated! So stressful and frsutrating as a newbie! Once I've done 1 I'm hoping it'll be plain sailing!!
Thanks!
C
You have the basic steps right. Check the php error logs on the server (probably accessible via the control panel if you dont have ssh access), they should give you more information as to what actually caused the 500 errors.
Doubt it is an htaccess issue unless you are doing something crazy in there.
Can you see he drupal admin at all? If so, clear cache, check watchdog for clues also.
It's easier to download and install Drupal again on the live server rather than to copy everything via FTP. The settings.php file is where your MySQL information is stored so this file should not be copied. Follow Drupal's documentation on how to install Drupal at https://drupal.org/documentation/install/download
To transfer your database, install and enable the Backup and Migrate module on your local server from https://drupal.org/project/backup_migrate and back up your database locally.
After Drupal is installed on the live server, go ahead and copy your modules, themes, and files from /sites/all and /sites/default/files (or any non-Drupal core files that you may have created). Enable and use the Backup and Migrate module to restore your database to your live server. You may need to configure the php.ini file if the database is over 8MB.

How to establish database connection with CakePHP on Server2Go?

I've been trying to use CakePHP on Server2Go portable server - but for some reason, I'm unable to connect to DB. Moreover, cake flashes some warnings about mod-rewrite.
I have no problems with setting up the same app on XAMPP or WAMPP, also I'm SURE that I'm using the right db details: localhost, root, (no password), and db_name.
Wordpress, drupal, joomla, CI - there are no problems with setting them up to run on Server2Go, but CakePHP is unable to establish DB connection...
What am I doing wrong????
I had to do this:
In the server2go folder there is a file called pms_config. Open it and look for [database]. Below there should be an entry like this
MySQLPort=xxxx
In the Cake db config set host as 127.0.0.1:xxxx where xxxx is the port number from pms_config.
Hope this helps.
You need to enable php_pdo_mysql.dll extension first.
To do that, edit php.ini (into config_tpl dir for Server2Go) and uncomment (remove ; from the start of the line).
Then, restart Server2Go, done!
Be carefull when using old auth method for MySQL users, PDO and/or CakePHP dosent like this anymore!
Then, check the MySQL Port and set CakePHP Database config file to use "localhost:XXXX" where XXX is the MySQL port of Server2Go MySQL Server.
Sucess!

Resources