Monday 9 March 2020

Let's run Lumen on top of XAMPP (No good >> so many errors)

Lumen migrate error

ubuntu@ip-172-31-16-44:/opt/lampp/htdocs/authors$ sudo php artisan migrate

In Connection.php line 669:
                                                                                                                                         
  could not find driver (SQL: select * from information_schema.tables where table_schema = matthew_schema and table_name = migrations and 
  table_type = 'BASE TABLE')                                                                                                             
                                                                                                                                         

In Connector.php line 70:
                       
  could not find driver
                       

I found that XAMPP did not install MySQL...

ubuntu@ip-172-31-16-44:/opt/lampp/mysql$ mysql

Command 'mysql' not found, but can be installed with:

sudo apt install mysql-client-core-5.7 
sudo apt install mariadb-client-core-10.1

ubuntu@ip-172-31-16-44:/opt/lampp/mysql$ sudo apt install mysql-client-core-5.7

MariaDB is MySQL. You can run
ubuntu@ip-172-31-16-44:~/bin$ /opt/lampp/bin/mysql

https://askubuntu.com/questions/95241/how-do-i-start-the-mysql-console-in-xampp

ubuntu@ip-172-31-16-44:~/bin$ sudo ln -s /opt/lampp/bin/mysql /usr/local/bin/mysql

Now, you don't have below error - Can't connect to local MySQL ... any more when you type in 'mysql'.


I had to install mysql server not mysql-client.



ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
When you type mysql and enter, I got above error.


Install Lumen on Xampp Ubuntu
https://www.codentricks.com/installing-xampp-laravel-linux/

It talks about ln -s command etc.

Same approach as before...
https://stackoverflow.com/questions/50994393/laravel-php-artisan-migrate
https://stackoverflow.com/questions/50177216/how-to-grant-all-privileges-to-root-user-in-mysql-8-0

MariaDB [(none)]> CREATE USER 'user'@'localhost' IDENTIFIED WITH mysql_native_password BY 'yourpassword';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'BY 'yourpassword'' at line 1
MariaDB [(none)]> CREATE USER 'user'@'localhost' IDENTIFIED BY 'yourpassword';
Query OK, 0 rows affected (0.005 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON *.* TO 'user'@'localhost' WITH GRANT OPTION;
Query OK, 0 rows affected (0.000 sec)



No comments:

Post a Comment