every time I try the migrate command in laravel it does not do it and returns this error :
Error
my file .env:
Env File
my file database.php:
Database.php file
could you help me with this?
I already created the myapp database in phpmyadmin but I can't migrate
Related
I am using mysqlsh to connect to mysql database running in docker container.
I can source sql file using sql; but can not source exactly same file using mysqlsh.
I googled for the solution yet to find the one.
I have a database in MySQL which can be accessed using Microsoft SQL Server Management Studios. I have a .bak file of that database and I want to shift this database to Postgres.
I went to the command line and I opened the directory of my Postgres to the bin folder from the program files, and I wrote the command :
psql -U postgres -d postgres < (directory of the .bak file)'
I got the following error on running the above command:
ERROR: syntax error at or near "TAPE"
LINE 1: TAPE
Can someone please explain why I am getting this error and how to resolve it?
I created MySQL cluster of nodes (2 datanodes, 1 management node, and 1 MySQL server node) on Docker Following the instructions from this link:
https://mysqlmed.wordpress.com/2017/09/04/mysql-cluster-in-docker-quick-step-by-step
Then I created a MySQL table to import a csv file (named daily.csv) using the command:
LOAD DATA INFILE 'C:/Users/Utilisateur/Desktop/daily.csv' INTO TABLE daily IGNORE 1 LINES;
and I got the error:
ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement.
When I add LOAD DATA LOCAL INFILE ..
I get this error:
ERROR 2 (HY000): File 'C:/Users/Utilisateur/Desktop/daily.csv' not found (Errcode: 2 - No such file or directory)
When i check my secure-file-priv using the command:
SELECT ##global.secure_file_priv
I get the Following path: /var/lib/mysql-files/ but I have no idea how to access to it in order to copy my csv file, or even to access my.ini MySQL config file to change the variable secure-file-priv into NULL, which as I saw is another solution to get permissions to access my file.
As I am using Docker, I have no idea how to access the MySQL container config file.
I tried many ways but I see no issue. Could you please help me with this I would be very delighted as I spent a lot of time trying to fix it??
I followed these instructions but don't know where the file /etc/mysql/my.cnf to change the variable secure_file_priv to NULL is:
Mysql making --secure-file-priv option to NULL
In your case it might be sufficient to mount your local directory inside the directory expected by mysql (/var/lib/mysql-files/).
Try starting the container with an additional -v parameter, like this:
docker run -d -v C:/Users/Utilisateur/Desktop/:/var/lib/mysql-files --net=cluster --name=mysql1 --ip=192.168.0.10 -e MYSQL_RANDOM_ROOT_PASSWORD=true mysql/mysql-cluster mysqld
Or copy the file into the folder:
docker cp C:/Users/Utilisateur/Desktop/daily.csv mysql1:/var/lib/mysql-files
assuming the name of your container is mysql1, as in the link you provided.
I need your help again.
Is there a way to reset all configuration in MySQL?
Here's what happened. I previously have a project installed and this time I'm setting up a new one.
In this new project, I wanted to set it up with my a new database, new username I created and password. However, when I reached the point where I had to execute php artisan migrate, it keeps throwing me an error saying PDOException::("SQLSTATE[HY000] [2002] No such file or directory")
If not that error, it's throwing connection refused instead.
Note: I'm using laradock.
Now, I'm at the point where I'd just rather reset the whole MySQL because I'm thinking it's conflicting with my previous configuration with my previous project.
As I searched online, I've tried the following:
1. Restarted server
2. Changed db_host from 127.0.0.1 to localhost and vice-versa
3. Added the project's directory to the dev environment setting
4. Docker-compose down and then up again
5. Even uninstalled and reinstalled docker itself
DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=newdbname
DB_USERNAME=newusername
DB_PASSWORD=newpassword!
All I want is to be able to execute php artisan migrate using the new credentials I set.
If you really do not need any old data in database, you can just delete them & reset up a container:
# stop mysql service
docker-compose stop mysql
# delete old mysql database
rm -rf ~/.laradock/data/mysql
# resetup mysql container
docker-compose up -d nginx mysql
You can get the mysql database location according to docker-compose.yml & env-example:
docker-compose.yml:
volumes:
- ${DATA_PATH_HOST}/mysql:/var/lib/mysql
env-example:
DATA_PATH_HOST=~/.laradock/data
Hello im creating a batch file to install the wampserver . After that i want to import my name.sql file into the dabase that wampserver created. Im using this command :
mysql --u [bonis] --password=[bonis] ["jdbc:mysql://localhost"] < ["C:\Documents and Settings\Bonis\Desktop\bpx.sql"]
pause
And telling me this : "The filename, directoryname, or volume label syntax is incorrect."
Any ideas?
Use the following command line: mysql < name.sql
Your sql code in the file has to contain "create database" and "create table" commands, though.