Mysql
 sql >> Teknologi Basis Data >  >> RDS >> Mysql

Akses basis data dengan Angular

1- Apakah mungkin untuk mengakses database MySQL dalam kerangka sudut?

Pertanyaannya tidak spesifik sudut tetapi YA itu mungkin , karena MySQL 5.7 dapat memasukkan, memperbarui, dan menghapus catatan di MySQL melalui HTTP. Sesuatu seperti ini

http://127.0.0.1:8080/sql/myhttp/SELECT+name_first,+name_last+FROM+names 
``` [refer here][1]

> Hence you can interact with MySQL directly with any HTTP client  with
> out any middle-ware.

 By HTTP Client I mean Curl,Wget or any Http library/API of any language (ajax,request,fetch,axios ... for JavaScript/node) 

2 - Would that be insecure like other JavaScript?

Again not JavaScript specific, But **Yes it's insecure(not recommended)** to directly interact with the database from the client.
  Why?
You need to handle database security issues like SQL Injection from the client side (angular in this case). It's is very inconvenient to do that.


  [1]: https://scriptingmysql.wordpress.com/2015/01/15/mysql-5-7-labs-and-the-http-plugin-inserting-updating-and-deleting-records-in-mysql-via-http/

> I do recommend to always have database access middle-ware
> (php,node,python ...) than interacting from client side



  1. Database
  2.   
  3. Mysql
  4.   
  5. Oracle
  6.   
  7. Sqlserver
  8.   
  9. PostgreSQL
  10.   
  11. Access
  12.   
  13. SQLite
  14.   
  15. MariaDB
  1. MySQL sangat lambat untuk mengubah kueri tabel

  2. IntegrityError:(1062, entri duplikat untuk kunci)

  3. Menginstal dan Mengonfigurasi MySQL di Ubuntu 20.04

  4. Cara Menginstal MySQL 8 di Ubuntu 20.04 LTS

  5. mysql agregat UDF (fungsi yang ditentukan pengguna) di C