Results: 1024
Create TRIGGER after INSERT
Creates trigger that runs
after
insert
and logs into
log
table
DROP TRIGGER IF EXISTS after_student_insert;

DELIMITER $$

    CREATE TRIGGER after_student_insert BEFORE INSERT 
    ON students
    FOR EACH ROW 
    BEGIN

    INSERT INTO log (description)
    VALUES ('One student inserted');

    END$$

DELIMITER ;
Converts radians back to degrees. Half of
PI
radians
1.5707963267948966
converted to degrees gives us
90
degrees.
PI
:
3.141592653589793
radians converted to degrees gives us
180
degrees.
SELECT
    DEGREES(1.5707963267948966),
    DEGREES(3.141592653589793)
tinyint data type
In Laravel 8+
tinyInteger
method generates
tinyint(4)
data type in MySQL
$table->tinyInteger('column_name');
Whereas
boolean
method generates
tinyint(1)
data type
$table->$table->boolean('column_name');
edit file
Opens
.env
file with edit mode using command line interface
sudo nano .env
We can specify the file with full address
sudo nano /var/www/csmp.ge/.env
delete file
Deletes specified file
sudo unlink /etc/nginx/sites-enabled/csmp.use.ge
copy file
Duplicates
.env.example
file, names it
.env
and places it in the same directory
sudo cp .env.example .env
clone remote repository
After installing
Git
on the server, we can clone remote repository
sudo git clone https://tandilashvili@bitbucket.org/tandilashvili/csmp.git
The command clones the remote repository of
csmp
project
reload nginx
Reloads
nginx
server to apply changes
sudo systemctl reload nginx
run queries
We can run queries (that are inside
queries
file) from Linux command line
mysql -u test_user -p test_db < /var/www/queries.sql
The queries inside the file will be run into
test_db
using
test_user
user. Note: The above command can be used to restore database, or add some tables, or insert some rows.
change password for MySQL root user
Changes password for MySQL
root
user to
some password
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'some password';
Results: 1024