sql 设置亚马逊LAMP

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sql 设置亚马逊LAMP相关的知识,希望对你有一定的参考价值。

# Connect to LAMP Server using a id_rsa
ssh -i ~/Projects/path-to/id_rsa username@servername

sudo bash               # Set the correct user rights for this session
cd /var/www/            # Change directory to the parent of Doc Root
chown -R username html  # Assign Doc Root to the user `username`
chgrp wheel html        # Set Apache Group to the `html` Folder
 
# Apache im Bedarfsfall neu starten
sudo service httpd restart

# Start MySQL Server
/sbin/service mysqld start  # Start MySQL Server
mysql -u root               # Login to Database Server
/* User des Projekts erstellen */
CREATE USER 'myUser'@'localhost' IDENTIFIED BY 'myPassword';
 
/* Zugriff erteilen und Benutzereinstellungen neu laden */
GRANT ALL PRIVILEGES ON * . * TO 'myUser'@'localhost';
 
FLUSH PRIVILEGES;
 
/* Datenbank anlegen */
CREATE DATABASE tablename;
USE tablename;
 
/* Tabellen anlegen */
CREATE TABLE `foobar` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `text` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
/* Kontrolle */
DESCRIBE advent_profiles;

以上是关于sql 设置亚马逊LAMP的主要内容,如果未能解决你的问题,请参考以下文章

sh 【亚马逊Linux2】LAMP构成

LAMP 和 PhpMyadmin 由 Intuz 提供支持 - 亚马逊 AWS

LAMP/Ubuntu 上的样式表渲染问题

LAMP搭建sql-labs渗透测试环境

亚马逊免费服务器搭建Discuz!论坛过程

亚马逊 EC2 + SSL